KYLIN-1912 print sql with beeline
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/75f92470 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/75f92470 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/75f92470 Branch: refs/heads/tpy Commit: 75f924705a1593e44b7a07c4e5d09753aa1e1054 Parents: df3ec7e Author: shaofengshi <shaofeng...@apache.org> Authored: Fri Jul 22 11:45:16 2016 +0800 Committer: shaofengshi <shaofeng...@apache.org> Committed: Fri Jul 22 11:45:16 2016 +0800 ---------------------------------------------------------------------- .../java/org/apache/kylin/source/hive/HiveCmdBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/75f92470/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java ---------------------------------------------------------------------- diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java index 5a8278e..bab902d 100644 --- a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java +++ b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveCmdBuilder.java @@ -18,10 +18,7 @@ package org.apache.kylin.source.hive; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; +import java.io.*; import java.util.ArrayList; import org.apache.commons.io.IOUtils; @@ -78,6 +75,9 @@ public class HiveCmdBuilder { buf.append(tmpHql.getAbsolutePath()); logger.info("The statements to execute in beeline: \n" + hqlBuf); + if (logger.isDebugEnabled()) { + logger.debug("The SQL to execute in beeline: \n" + IOUtils.toString(new FileReader(tmpHql))); + } } catch (IOException e) { throw new RuntimeException(e); } finally {