jonvex commented on code in PR #8666:
URL: https://github.com/apache/hudi/pull/8666#discussion_r1195160560


##########
hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestBootstrapRead.java:
##########
@@ -0,0 +1,297 @@
+/*
+ * 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.hudi.functional;
+
+import org.apache.hudi.DataSourceReadOptions;
+import org.apache.hudi.DataSourceWriteOptions;
+import org.apache.hudi.client.bootstrap.selector.BootstrapRegexModeSelector;
+import 
org.apache.hudi.client.bootstrap.selector.FullRecordBootstrapModeSelector;
+import 
org.apache.hudi.client.bootstrap.selector.MetadataOnlyBootstrapModeSelector;
+import org.apache.hudi.common.testutils.HoodieTestDataGenerator;
+import org.apache.hudi.config.HoodieBootstrapConfig;
+import org.apache.hudi.config.HoodieCompactionConfig;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.keygen.ComplexKeyGenerator;
+import org.apache.hudi.keygen.NonpartitionedKeyGenerator;
+import org.apache.hudi.keygen.SimpleKeyGenerator;
+import org.apache.hudi.testutils.HoodieSparkClientTestBase;
+
+import org.apache.spark.api.java.JavaRDD;
+import org.apache.spark.sql.Dataset;
+import org.apache.spark.sql.Row;
+import org.apache.spark.sql.SaveMode;
+import org.apache.spark.sql.functions;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static 
org.apache.hudi.common.testutils.RawTripTestPayload.recordToString;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests different layouts for bootstrap base path
+ */
+@Tag("functional")
+public class TestBootstrapRead extends HoodieSparkClientTestBase {
+
+  @TempDir
+  public java.nio.file.Path tmpFolder;
+  protected String bootstrapBasePath = null;
+  protected String bootstrapTargetPath = null;
+  protected String hudiBasePath = null;
+
+  protected static int nInserts = 100;
+  protected static int nUpdates = 20;
+  protected static String[] dashPartitionPaths = {"2016-03-15", "2015-03-16", 
"2015-03-17"};
+  protected static String[] slashPartitionPaths = {"2016/03/15", "2015/03/16", 
"2015/03/17"};
+  protected String bootstrapType;
+  protected Boolean dashPartitions;
+  protected String tableType;
+  protected Integer nPartitions;
+
+  protected String[] partitionCols;
+  protected static String[] dropColumns = {"_hoodie_commit_time", 
"_hoodie_commit_seqno", "_hoodie_record_key",  "_hoodie_file_name", 
"city_to_state"};
+
+  @BeforeEach
+  public void setUp() throws Exception {
+    bootstrapBasePath = tmpFolder.toAbsolutePath() + "/bootstrapBasePath";
+    hudiBasePath = tmpFolder.toAbsolutePath() + "/hudiBasePath";
+    bootstrapTargetPath = tmpFolder.toAbsolutePath() + "/bootstrapTargetPath";
+    initSparkContexts();
+  }
+
+  @AfterEach
+  public void tearDown() throws IOException {
+    cleanupSparkContexts();
+    cleanupClients();
+    cleanupTestDataGenerator();
+  }
+
+  private static Stream<Arguments> testArgs() {
+    Stream.Builder<Arguments> b = Stream.builder();
+    //TODO: add dash partitions false with [HUDI-4944]

Review Comment:
   I changed the line below to:
   Boolean[] dashPartitions = {true/*,false*/};
   
   The code is already there to test that, it just doesn't work currently 
because of the double decoding issue



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