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


##########
spark-connector/v3.5/spark/src/test/java/org/apache/gravitino/spark/connector/jdbc/TestSparkJdbcTypeConverter35.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.TimestampType;
+import org.apache.spark.sql.types.DataTypes;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class TestSparkJdbcTypeConverter35 {
+
+  // GravitinoJdbcCatalogSpark35.getSparkTypeConverter() returns 
SparkJdbcTypeConverter34.
+  private final SparkJdbcTypeConverter34 converter = new 
SparkJdbcTypeConverter34();
+
+  @Test
+  void testDatetimeWithoutTimezoneConvertsToTimestampType() {
+    // Spark 3.5 introduces TimestampNTZType (via SparkTypeConverter34). 
Without the JDBC override,
+    // MySQL datetime (withoutTimeZone) would map to TimestampNTZType, which 
the MySQL JDBC dialect
+    // cannot format as valid SQL, causing syntax errors like "near ':07:43)'".

Review Comment:
   The comment says Spark 3.5 introduces `TimestampNTZType`, but this type is 
already present in Spark 3.4+ (as evidenced by `SparkTypeConverter34`). This is 
misleading documentation for why the override is needed.



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