Copilot commented on code in PR #12105:
URL: https://github.com/apache/gravitino/pull/12105#discussion_r3618948084


##########
docs/spark-connector/spark-connector.md:
##########
@@ -106,6 +106,7 @@ Gravitino spark connector support the following datatype 
mapping between Spark a
 | `StructType`                      | `struct`                      | 0.5.0    
     |
 
 :::note
-For Gravitino `UUID` type, Spark connector represents it as `StringType` 
because Spark has no native UUID type.
-This behavior is consistent with Spark built-in PostgreSQL JDBC mapping 
(`uuid` -> `StringType`).
+For Gravitino `UUID` and `ExternalType` types, Spark connector represents them 
as `StringType`:
+- `UUID`: Spark has no native UUID type. This behavior is consistent with 
Spark built-in PostgreSQL JDBC mapping (`uuid` -> `StringType`).
+- `ExternalType`: Represents types that have no Gravitino-native mapping (e.g. 
ClickHouse `IPv4`/`IPv6`, Doris `LARGEINT`/`BITMAP`, Glue unknown types). These 
columns are preserved as `StringType` so that tables remain loadable in Spark. 
Users can `CAST` to the desired type as needed, e.g. `CAST(ip AS STRING)`.

Review Comment:
   The example `CAST(ip AS STRING)` is misleading here because `ExternalType` 
columns are already represented as `StringType`, so casting to STRING is a 
no-op. Consider removing the example or replacing it with a cast to a different 
Spark SQL type to illustrate the intent.



##########
catalogs-contrib/catalog-jdbc-clickhouse/src/test/java/org/apache/gravitino/catalog/clickhouse/integration/test/CatalogClickHouseIT.java:
##########
@@ -2482,4 +2482,29 @@ void testLoadTableWithoutSettings() {
     // SHOW CREATE TABLE output, so one settings key is expected even without 
explicit SETTINGS.
     Assertions.assertEquals(1, settingsCount);
   }
+
+  @Test
+  void testIPv4ColumnIsExternalType() {
+    // Verify that real ClickHouse IPv4 columns are mapped to ExternalType in 
Gravitino metadata.
+    // Verify that ClickHouse IPv4 columns are exposed as ExternalType in 
Gravitino

Review Comment:
   These two consecutive comment lines repeat the same sentence starter 
(“Verify that …”). Collapsing them into a single line improves readability 
without changing meaning.



##########
spark-connector/v3.4/spark/src/test/java/org/apache/gravitino/spark/connector/jdbc/TestSparkJdbcTypeConverter34.java:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.spark.connector.jdbc;
+
+import org.apache.gravitino.rel.types.Types;
+import org.apache.spark.sql.types.DataTypes;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+/** Unit tests for {@link SparkJdbcTypeConverter34}. */
+public class TestSparkJdbcTypeConverter34 {
+
+  private final SparkJdbcTypeConverter34 sparkJdbcTypeConverter34 = new 
SparkJdbcTypeConverter34();

Review Comment:
   This field initialization line exceeds typical Google Java Style line-length 
limits and is inconsistent with other v3.4 tests that wrap long initializations 
(e.g., TestSparkTableChangeConverter34). Wrapping it avoids potential 
checkstyle/spotless failures.



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