jerryshao commented on code in PR #14932:
URL: https://github.com/apache/gravitino/pull/14932#discussion_r4625397305


##########
spark-connector/spark-common/src/main/spark35/org/apache/gravitino/spark/connector/paimon/PaimonPropertiesConverter.java:
##########
@@ -64,4 +66,35 @@ public Map<String, String> 
toGravitinoTableProperties(Map<String, String> proper
   public Map<String, String> toSparkTableProperties(Map<String, String> 
properties) {
     return new HashMap<>(properties);
   }
+
+  /**
+   * Converts the Spark table properties of a table created in a Paimon 
catalog with the Hive
+   * backend, the only Paimon backend that can create format tables. It 
follows Paimon's own
+   * SparkCatalog: a file format provider (csv, json, orc, parquet, ...) from 
the USING clause makes
+   * a format table of that format, "paimon" or no provider keeps a Paimon 
table, and LOCATION
+   * becomes the Paimon table path. Other backends keep the properties as they 
are.
+   *
+   * @param properties the Spark table properties, already converted by {@link
+   *     #toGravitinoTableProperties(Map)}.
+   * @return the table properties to pass to the Hive backend.
+   */
+  Map<String, String> toHiveBackendTableProperties(Map<String, String> 
properties) {
+    Map<String, String> tableProperties = new HashMap<>(properties);
+    String provider = tableProperties.remove(TableCatalog.PROP_PROVIDER);
+    if (StringUtils.isNotBlank(provider)
+        && 
!PaimonPropertiesConstants.PAIMON_PROVIDER.equalsIgnoreCase(provider)) {

Review Comment:
   [P2] With `CREATE TABLE t (value STRING) USING text`, this condition sets 
`file.format=text`, but the pinned Paimon 1.2.0 backend rejects it with `Format 
table unsupported file format`. Paimon’s own SparkCatalog only converts 
providers accepted by `isFormatTable`, preserving Paimon-table creation 
otherwise. Please use the same supported-format check and add a regression test 
for `text` alongside the CSV/Parquet cases.



-- 
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