Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153711427
--- Diff: integration/spark2/src/main/spark2.1/CarbonSessionState.scala ---
@@ -147,22 +150,31 @@ class CarbonSessionState(sparkSession: SparkSession)
extends HiveSessionState(sp
override lazy val optimizer: Optimizer = new CarbonOptimizer(catalog,
conf, experimentalMethods)
+ def extendedAnalyzerRules: Seq[Rule[LogicalPlan]] = Nil
+ def internalAnalyzerRules: Seq[Rule[LogicalPlan]] = {
+ catalog.ParquetConversions ::
+ catalog.OrcConversions ::
+ CarbonPreInsertionCasts(sparkSession) ::
+ CarbonPreAggregateQueryRules(sparkSession) ::
+ CarbonIUDAnalysisRule(sparkSession) ::
+ AnalyzeCreateTable(sparkSession) ::
+ PreprocessTableInsertion(conf) ::
+ DataSourceAnalysis(conf) ::
+ (if (conf.runSQLonFile) {
+ new ResolveDataSource(sparkSession) :: Nil
+ } else { Nil }
+ )
+ }
+
override lazy val analyzer: Analyzer = {
new Analyzer(catalog, conf) {
override val extendedResolutionRules =
- catalog.ParquetConversions ::
- catalog.OrcConversions ::
- CarbonPreInsertionCasts(sparkSession) ::
- CarbonPreAggregateQueryRules(sparkSession) ::
- CarbonIUDAnalysisRule(sparkSession) ::
- AnalyzeCreateTable(sparkSession) ::
- PreprocessTableInsertion(conf) ::
- DataSourceAnalysis(conf) ::
- (if (conf.runSQLonFile) {
- new ResolveDataSource(sparkSession) :: Nil
- } else { Nil }
- )
-
+ if (!extendedAnalyzerRules.isEmpty) {
--- End diff --
change to nonEmpty
---