Эх сурвалжийг харах

[sparksql] Convert unicode values to str (#2926)

Harsh Gupta 3 жил өмнө
parent
commit
f545a3c3f2

+ 4 - 0
desktop/libs/notebook/src/notebook/connectors/spark_shell.py

@@ -721,6 +721,10 @@ class SparkDescribeTable(Table):
     partition_flag = True
     partition_flag = True
 
 
     for d in self.data:
     for d in self.data:
+      d[0] = str(d[0])
+      d[1] = str(d[1])
+      d[2] = str(d[2])
+
       if cols_flag:
       if cols_flag:
         if (d[0] == d[1] == d[2] == '') or d[0].startswith('#'):
         if (d[0] == d[1] == d[2] == '') or d[0].startswith('#'):
           cols_flag = False
           cols_flag = False

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/spark_shell_tests.py

@@ -356,7 +356,7 @@ class TestSparkApi(object):
     response = self.api.describe_table(notebook, snippet, 'default', 'test_nonacid')
     response = self.api.describe_table(notebook, snippet, 'default', 'test_nonacid')
 
 
     assert_equal(response, {
     assert_equal(response, {
-      'cols': [{'comment': None, 'name': 'nname', 'type': 'string'}],
+      'cols': [{'comment': 'None', 'name': 'nname', 'type': 'string'}],
       'comment': '',
       'comment': '',
       'details': {'properties': {
       'details': {'properties': {
         'create_time': 'Tue Jun 28 11:35:33 UTC 2022',
         'create_time': 'Tue Jun 28 11:35:33 UTC 2022',