KevinyhZou commented on code in PR #12428:
URL: https://github.com/apache/gluten/pull/12428#discussion_r3518101688


##########
gluten-flink/ut/src/test/java/org/apache/gluten/velox/GlutenRowtimeInserterHelperTest.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.gluten.velox;
+
+import org.apache.gluten.table.runtime.operators.GlutenOneInputOperator;
+
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.dag.Transformation;
+import org.apache.flink.streaming.api.operators.SimpleOperatorFactory;
+import org.apache.flink.streaming.api.operators.StreamMap;
+import org.apache.flink.streaming.api.transformations.OneInputTransformation;
+import org.apache.flink.table.data.RowData;
+import 
org.apache.flink.table.runtime.operators.sink.StreamRecordTimestampInserter;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+import org.apache.flink.table.types.logical.BigIntType;
+import org.apache.flink.table.types.logical.RowType;
+
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class GlutenRowtimeInserterHelperTest {
+

Review Comment:
   We use max timestamp in a batch record to replace the per-row timestamp, 
which is a different semantics,can we add a test for this?



##########
gluten-flink/planner/src/main/java/org/apache/gluten/velox/FileSystemSinkFactory.java:
##########
@@ -134,9 +134,15 @@ public Transformation<RowData> buildVeloxSink(
             "FileSystemInsertTable");
     GlutenOneInputOperatorFactory<?, ?> operatorFactory =
         new GlutenOneInputOperatorFactory(onewInputOperator);
+    // If rowtime transformation was applied (rowtimeFieldIndex != -1), a 
native
+    // StreamRecordTimestampInserter sits at this position. Replace it with a 
Gluten columnar
+    // inserter so the chain stays columnar end-to-end; otherwise this is a 
no-op.
+    Transformation<RowData> veloxFileWriterInput =
+        GlutenRowtimeInserterHelper.processTransformation(
+            (Transformation<RowData>) 
fileWriterTransformation.getInputs().get(0));

Review Comment:
   In gluten-flink,operator `StreamingFileWriter` will totally offload to 
velox, and velox's `file writer` will not rely on the `StreamRecord`.timestamp 
to determine partition, roll file, or commit partition, therefore, 
`StreamRecordTimestampInserter` is just a useless operator, we should just 
remove it from the op chain. 



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