소스 검색

HUE-6011 [editor] Hint on potentially missing jar registration when using Json table serde

Romain Rigaux 8 년 전
부모
커밋
1e8cb3b

+ 3 - 3
desktop/libs/indexer/src/indexer/templates/gen/create_table_statement.mako

@@ -84,15 +84,15 @@ EXTERNAL \
 % endif
 TABLE ${ '`%s`.`%s`' % (database, table["name"]) | n }
 ${ column_list(table, columns) | n } \
-% if partition_columns and table.get('file_format') != 'kudu':
-PARTITIONED BY ${ column_list(table, partition_columns) | n }
-% endif
 % if kudu_partition_columns  and table.get('file_format') == 'kudu':
 PARTITION BY ${ ', '.join([kudu_partition(partition) for partition in kudu_partition_columns]) | n }
 % endif
 % if table["comment"]:
 COMMENT "${table["comment"] | n }"
 % endif
+% if partition_columns and table.get('file_format') != 'kudu':
+PARTITIONED BY ${ column_list(table, partition_columns) | n }
+% endif
 ## TODO: CLUSTERED BY here
 ## TODO: SORTED BY...INTO...BUCKETS here
 % if table.get('row_format'):

+ 2 - 0
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -262,6 +262,8 @@ class HS2Api(Api):
     if status.index in (QueryHistory.STATE.failed.index, QueryHistory.STATE.expired.index):
       if operation.errorMessage and 'transition from CANCELED to ERROR' in operation.errorMessage: # Hive case on canceled query
         raise QueryExpired()
+      elif  operation.errorMessage and re.search('Cannot validate serde: org.apache.hive.hcatalog.data.JsonSerDe', str(operation.errorMessage)):
+        raise QueryError(message=operation.errorMessage + _('. Is hive-hcatalog-core.jar registered?'))
       else:
         raise QueryError(operation.errorMessage)