You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2019/06/18 13:56:29 UTC

[kylin] 03/04: fix beeline meta data parser on partition information

This is an automated email from the ASF dual-hosted git repository.

nic pushed a commit to branch master-hadoop3.1
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit e144a02fa3dcad9c0779a456c4405929348673ee
Author: sickcate <ia...@gmail.com>
AuthorDate: Tue Apr 23 17:08:14 2019 +0800

    fix beeline meta data parser on partition information
---
 .../apache/kylin/source/hive/BeelineHiveClient.java   | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/BeelineHiveClient.java b/source-hive/src/main/java/org/apache/kylin/source/hive/BeelineHiveClient.java
index 7f1f61d..c6fdee3 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/BeelineHiveClient.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/BeelineHiveClient.java
@@ -213,20 +213,21 @@ public class BeelineHiveClient implements IHiveClient {
         }
     }
 
-    private void parseResultEntry(ResultSet resultSet, HiveTableMetaBuilder builder) throws SQLException {
+    private void parseResultEntry(ResultSet resultSet, HiveTableMetaBuilder builder) throws  SQLException{
         List<HiveTableMeta.HiveTableColumnMeta> partitionColumns = Lists.newArrayList();
         if ("# Partition Information".equals(resultSet.getString(1).trim())) {
             resultSet.next();
             Preconditions.checkArgument("# col_name".equals(resultSet.getString(1).trim()));
             resultSet.next();
-            Preconditions.checkArgument("".equals(resultSet.getString(1).trim()));
-            while (resultSet.next()) {
-                if ("".equals(resultSet.getString(1).trim())) {
-                    break;
-                }
-                partitionColumns.add(new HiveTableMeta.HiveTableColumnMeta(resultSet.getString(1).trim(),
-                        resultSet.getString(2).trim(), resultSet.getString(3).trim()));
-            }
+        if ("".equals(resultSet.getString(1).trim()))
+            resultSet.next();
+        do {
+             if ("".equals(resultSet.getString(1).trim())) {
+                 break;
+             }
+             partitionColumns.add(new HiveTableMeta.HiveTableColumnMeta(resultSet.getString(1).trim(),
+                     resultSet.getString(2).trim(), resultSet.getString(3).trim()));
+        } while (resultSet.next());
             builder.setPartitionColumns(partitionColumns);
         }