mchades commented on code in PR #10998:
URL: https://github.com/apache/gravitino/pull/10998#discussion_r3256644111


##########
catalogs/hive-metastore-common/src/main/java/org/apache/gravitino/hive/converter/HiveTableConverter.java:
##########
@@ -135,13 +151,29 @@ public static org.apache.hadoop.hive.metastore.api.Table 
toHiveTable(HiveTable h
         hiveTable.properties().getOrDefault(TABLE_TYPE, 
String.valueOf(TableType.MANAGED_TABLE));
     table.setTableType(tableType.toUpperCase());
 
-    List<FieldSchema> partitionFields =
-        hiveTable.partitionFieldNames().stream()
-            .map(fieldName -> buildPartitionKeyField(fieldName, hiveTable))
-            .collect(Collectors.toList());
-    table.setSd(buildStorageDescriptor(hiveTable, partitionFields));
+    if (TableType.VIRTUAL_VIEW.name().equalsIgnoreCase(tableType)) {
+      // Views require a minimal StorageDescriptor (HMS validates its 
presence), while the output
+      // schema is stored in sd.cols.
+      StorageDescriptor sd = new StorageDescriptor();
+      sd.setCols(buildStorageDescriptor(hiveTable, 
Collections.emptyList()).getCols());
+      sd.setSerdeInfo(new SerDeInfo());

Review Comment:
   view does not need SerDe



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to