FrankChen021 commented on code in PR #20729:
URL: https://github.com/apache/druid/pull/20729#discussion_r4378042422


##########
extensions-contrib/tsfile-extensions/src/test/java/org/apache/druid/data/input/tsfile/TsFileInputFormatTest.java:
##########
@@ -0,0 +1,285 @@
+/*
+ * 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.druid.data.input.tsfile;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.druid.data.input.ColumnsFilter;
+import org.apache.druid.data.input.InputEntityReader;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputRow;
+import org.apache.druid.data.input.InputRowSchema;
+import org.apache.druid.data.input.impl.DimensionsSpec;
+import org.apache.druid.data.input.impl.FileEntity;
+import org.apache.druid.data.input.impl.TimestampSpec;
+import org.apache.druid.error.DruidException;
+import org.apache.druid.jackson.DefaultObjectMapper;
+import org.apache.druid.java.util.common.DateTimes;
+import org.apache.druid.java.util.common.parsers.CloseableIterator;
+import org.apache.tsfile.exception.write.WriteProcessException;
+import org.joda.time.Interval;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class TsFileInputFormatTest

Review Comment:
   This is still a unit test. It's better to include two test cases in the 
`embedded-tests` module to perform end to end test(can refer to the delta lake 
extension `embedded-tests/.../deltalake/DeltaLakeInputSourceIngestionTest.java`)
   
   1. a test case uses batch ingestion task spec
   2. a test case uses the MSQ INSERT-SELECT sql, for example:
   ```
   INSERT INTO xxx
   SELECT a,b,c,d...
   FROM TABLE(EXTERN(
     'json-style-spec'
   ))
   PARTITIONED BY DAY
   ```
   
   3. if possible, we can extend `InputFormats.BaseFormatDefn` to support the 
following syntax which is simpler than above json-spec as:
   
   ```sql
   INSERT INTO xxx
   SELECT a,b,c,d
   FROM TABLE(local(
     baseDir  => '/data/iot',
     filter   => '*.tsfile',
     format   => 'tsfile',
     tables   => ARRAY['sensor'],
     "interval" => '2026-01-01/2026-02-01'
   )) EXTEND ("Time" BIGINT, region VARCHAR, device VARCHAR, temperature DOUBLE)
   PARTITIONED BY DAY
   ```



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