You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ya...@apache.org on 2021/11/19 12:41:35 UTC

[kylin] branch main updated: KYLIN-5069 Fix can't get location (#1776)

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

yaqian pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/main by this push:
     new cdc21bc  KYLIN-5069 Fix can't get location (#1776)
cdc21bc is described below

commit cdc21bca775fd50ecb07bae05fa1ea56eac18882
Author: Yaqian Zhang <59...@qq.com>
AuthorDate: Fri Nov 19 20:38:53 2021 +0800

    KYLIN-5069 Fix can't get location (#1776)
---
 .../src/main/java/org/apache/kylin/source/hive/SparkHiveClient.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/SparkHiveClient.java b/source-hive/src/main/java/org/apache/kylin/source/hive/SparkHiveClient.java
index b7daab0..4507e4e 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/SparkHiveClient.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/SparkHiveClient.java
@@ -90,7 +90,11 @@ public class SparkHiveClient implements IHiveClient {
         Map<String, String> properties = catalogTable.ignoredProperties();
         builder.setAllColumns(allColumns);
         builder.setPartitionColumns(partitionColumns);
-        builder.setSdLocation(catalogTable.location().getPath());
+        if (catalogTable.tableType().equals(CatalogTableType.MANAGED())) {
+            builder.setSdLocation(catalogTable.location().getPath());
+        } else {
+            builder.setSdLocation("unknown");
+        }
         long totalSize = properties.contains(TABLE_TOTAL_SIZE) ? Long.parseLong(properties.apply(TABLE_TOTAL_SIZE)) : 0L;
         builder.setFileSize(totalSize);
         long totalFileNum = properties.contains(TABLE_FILE_NUM) ? Long.parseLong(properties.apply(TABLE_FILE_NUM)) : 0L;