[ 
https://issues.apache.org/jira/browse/DRILL-7253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16914440#comment-16914440
 ] 

ASF GitHub Bot commented on DRILL-7253:
---------------------------------------

vvysotskyi commented on pull request #1847: DRILL-7253: Read Hive struct w/o 
nulls
URL: https://github.com/apache/drill/pull/1847#discussion_r317199453
 
 

 ##########
 File path: 
contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/complex_types/TestHiveStructs.java
 ##########
 @@ -0,0 +1,357 @@
+/*
+ * 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.drill.exec.hive.complex_types;
+
+import java.math.BigDecimal;
+import java.nio.file.Paths;
+
+import org.apache.drill.categories.HiveStorageTest;
+import org.apache.drill.categories.SlowTest;
+import org.apache.drill.exec.ExecConstants;
+import org.apache.drill.exec.hive.HiveTestFixture;
+import org.apache.drill.exec.hive.HiveTestUtilities;
+import org.apache.drill.exec.util.JsonStringHashMap;
+import org.apache.drill.exec.util.StoragePluginTestUtils;
+import org.apache.drill.exec.util.Text;
+import org.apache.drill.test.ClusterFixture;
+import org.apache.drill.test.ClusterTest;
+import org.apache.drill.test.TestBuilder;
+import org.apache.hadoop.hive.ql.Driver;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import static java.util.Arrays.asList;
+import static org.apache.drill.exec.expr.fn.impl.DateUtility.parseBest;
+import static org.apache.drill.exec.expr.fn.impl.DateUtility.parseLocalDate;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertThat;
+
+@Category({SlowTest.class, HiveStorageTest.class})
+public class TestHiveStructs extends ClusterTest {
+
+  private static final JsonStringHashMap<String, Object> STR_N0_ROW_1 = 
TestBuilder.mapOf(
+      "f_int", -3000, "f_string", new Text("AbbBBa"), "f_varchar", new 
Text("-c54g"), "f_char", new Text("Th"),
+      "f_tinyint", -128, "f_smallint", -32768, "f_decimal", new 
BigDecimal("375098.406"), "f_boolean", true,
+      "f_bigint", -9223372036854775808L, "f_float", -32.058f, "f_double", 
-13.241563769628,
+      "f_date", parseLocalDate("2018-10-21"),
+      "f_timestamp", parseBest("2018-10-21 04:51:36"));
+
+  private static final JsonStringHashMap<String, Object> STR_N0_ROW_2 = 
TestBuilder.mapOf(
+      "f_int", 33000, "f_string", new Text("ZzZzZz"), "f_varchar", new 
Text("-+-+1"), "f_char", new Text("hh"),
+      "f_tinyint", 127, "f_smallint", 32767, "f_decimal", new 
BigDecimal("500.500"), "f_boolean", true,
+      "f_bigint", 798798798798798799L, "f_float", 102.058f, "f_double", 
111.241563769628,
+      "f_date", parseLocalDate("2019-10-21"),
+      "f_timestamp", parseBest("2019-10-21 05:51:31"));
+
+  private static final JsonStringHashMap<String, Object> STR_N0_ROW_3 = 
TestBuilder.mapOf(
+      "f_int", 9199, "f_string", new Text("z x cz"), "f_varchar", new 
Text(")(*1`"), "f_char", new Text("za"),
+      "f_tinyint", 57, "f_smallint", 1010, "f_decimal", new 
BigDecimal("2.302"), "f_boolean", false,
+      "f_bigint", 101010L, "f_float", 12.2001f, "f_double", 1.000000000001,
+      "f_date", parseLocalDate("2010-01-01"),
+      "f_timestamp", parseBest("2000-02-02 01:10:09"));
+
+  private static final JsonStringHashMap<String, Object> STR_N2_ROW_1 = 
TestBuilder.mapOf("a",
+      TestBuilder.mapOf("b", TestBuilder.mapOf("c", 1000, "k", "Z")));
+
+  private static final JsonStringHashMap<String, Object> STR_N2_ROW_2 = 
TestBuilder.mapOf(
+      "a", TestBuilder.mapOf("b", TestBuilder.mapOf("c", 2000, "k", "X")));
+
+  private static final JsonStringHashMap<String, Object> STR_N2_ROW_3 = 
TestBuilder.mapOf(
+      "a", TestBuilder.mapOf("b", TestBuilder.mapOf("c", 3000, "k", "C")));
+
+  private static HiveTestFixture hiveTestFixture;
+
+  @BeforeClass
+  public static void setUp() throws Exception {
+    startCluster(ClusterFixture.builder(dirTestWatcher)
+        
.sessionOption(ExecConstants.HIVE_OPTIMIZE_PARQUET_SCAN_WITH_NATIVE_READER, 
true)
+        .configProperty("drill.exec.rpc.user.timeout", 9999999)
 
 Review comment:
   Could you please explain the reason for this change?
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Read Hive struct w/o nulls
> --------------------------
>
>                 Key: DRILL-7253
>                 URL: https://issues.apache.org/jira/browse/DRILL-7253
>             Project: Apache Drill
>          Issue Type: Sub-task
>            Reporter: Igor Guzenko
>            Assignee: Igor Guzenko
>            Priority: Major
>             Fix For: 1.17.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to