vamsikarnika commented on code in PR #11941:
URL: https://github.com/apache/hudi/pull/11941#discussion_r1761648651


##########
hudi-common/src/test/java/org/apache/hudi/avro/MercifulJsonConverterTestBase.java:
##########
@@ -0,0 +1,346 @@
+/*
+ * 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.avro;
+
+import org.junit.jupiter.params.provider.Arguments;
+
+import java.util.Arrays;
+import java.util.UUID;
+import java.util.stream.Stream;
+
+public class MercifulJsonConverterTestBase {
+
+  private static final String DECIMAL_AVRO_FILE_INVALID_PATH = 
"/decimal-logical-type-invalid.avsc";
+  private static final String DECIMAL_AVRO_FILE_PATH = 
"/decimal-logical-type.avsc";
+  private static final String DECIMAL_FIXED_AVRO_FILE_PATH = 
"/decimal-logical-type-fixed-type.avsc";
+  private static final String LOCAL_TIMESTAMP_MICRO_AVRO_FILE_PATH = 
"/local-timestamp-micros-logical-type.avsc";
+  private static final String LOCAL_TIMESTAMP_MILLI_AVRO_FILE_PATH = 
"/local-timestamp-millis-logical-type.avsc";
+  private static final String DURATION_AVRO_FILE_PATH_INVALID = 
"/duration-logical-type-invalid.avsc";
+
+  private static final String DURATION_AVRO_FILE_PATH = 
"/duration-logical-type.avsc";
+  private static final String DATE_AVRO_FILE_PATH = "/date-type.avsc";
+  private static final String DATE_AVRO_INVALID_FILE_PATH = 
"/date-type-invalid.avsc";
+  private static final String TIMESTAMP_AVRO_FILE_PATH = 
"/timestamp-logical-type2.avsc";
+
+  static Stream<Object> decimalBadCases() {
+    return Stream.of(
+        // Invalid schema definition.
+        Arguments.of(DECIMAL_AVRO_FILE_INVALID_PATH, "123.45", null, false),
+        // Schema set precision as 5, input overwhelmed the precision.
+        Arguments.of(DECIMAL_AVRO_FILE_PATH, "123333.45", null, false),

Review Comment:
   Have moved the test data generators to this base class, so that both row and 
avro conversions can use same data for testing. 



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