parthchandra commented on code in PR #4256:
URL: https://github.com/apache/datafusion-comet/pull/4256#discussion_r3211665807


##########
spark/src/test/resources/sql-tests/expressions/datetime/to_time.sql:
##########
@@ -0,0 +1,198 @@
+-- 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.
+
+-- MinSparkVersion: 4.1
+-- Config: spark.sql.timeType.enabled=true
+
+statement
+CREATE TABLE test_to_time(s STRING) USING parquet
+
+statement
+INSERT INTO test_to_time VALUES

Review Comment:
   
   added ' 12:30:45', '   12:30 PM', '00:00:00.1234567' to INSERT, plus queries 
for all 8 failing cases from the edge-case table (' 12:30:45', 
     '  12:30:45', ' 12:30:45 ', ' 1:00:00 PM', '\t12:30:45', '\n12:30:45', 
try_to_time(' 12:30:45'), try_to_time(' 1:00:00 PM')) 



##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########
@@ -360,6 +360,8 @@ object QueryPlanSerde extends Logging with CometExprShim 
with CometTypeShim {
         _: DoubleType | _: StringType | _: BinaryType | _: TimestampType | _: 
TimestampNTZType |
         _: DecimalType | _: DateType | _: BooleanType | _: NullType =>
       true
+    case dt if dt.getClass.getSimpleName.startsWith("TimeType") =>

Review Comment:
   done



##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########


Review Comment:
   I tried removing it but that caused `to_time` and `make_time` tests to fail. 
Added it back, it seems we should be okay. Expressions check the type they 
support in the expressions serde and only if all expressions convert then an 
operator will check `supportedDataType`. the only expression I found that 
allows TimeType but is unsupported was `hash` so that has a conditional check 
now.
   This does not apply to shuffle, btw, which will use its own 
`supportedSerializableDataType` check.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to