From 66982f342865e7bd8c256630cf4b6d38ec62890a Mon Sep 17 00:00:00 2001 From: s71955 Date: Sun, 24 Feb 2019 21:45:16 +0530 Subject: [PATCH] [CARBONDATA-3302] [Spark-Integration] code cleaning related to CarbonCreateTable command What changes were proposed in this pull request? Removed Extra check to validate whether the stream relation is not null , moreover condition can be optimized further, currently the condition has path validation whether path is part of s3 file system and then system is checking whether the stream relation is not null, this check can be added initially as this overall condition has to be evaluated for stream table only if stream is not null. This closes #3134 --- .../sql/execution/command/table/CarbonCreateTableCommand.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala index 12eb420f9fb..1e17ffe00ea 100644 --- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala +++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala @@ -78,8 +78,7 @@ case class CarbonCreateTableCommand( path } val streaming = tableInfo.getFactTable.getTableProperties.get("streaming") - if (path.startsWith("s3") && streaming != null && streaming != null && - streaming.equalsIgnoreCase("true")) { + if (streaming != null && streaming.equalsIgnoreCase("true") && path.startsWith("s3")) { throw new UnsupportedOperationException("streaming is not supported with s3 store") } tableInfo.setTablePath(tablePath)