Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-3407

distinct, count, Sum query fails when MV is created on single projection column

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • None
    • None

    Description

      distinct, count, Sum query fails when MV is created on single projection column

      sql("drop table if exists maintable")
      sql("create table maintable(name string, age int, add string) stored by 'carbondata'")
      sql("create datamap single_mv using 'mv' as select age from maintable")
      sql("insert into maintable select 'pheobe',31,'NY'")
      sql("insert into maintable select 'rachel',32,'NY'")
      sql("select distinct(age) from maintable")
      sql("select sum(age) from maintable")
      sql("select count(age) from maintable")

      Fails with below Exception:

      requirement failed: Fragment is not supported. Current frag:
      org.apache.carbondata.mv.plans.util.SQLBuildDSL$$anon$1@1f7f2e76
      java.lang.IllegalArgumentException: requirement failed: Fragment is not supported. Current frag:
      org.apache.carbondata.mv.plans.util.SQLBuildDSL$$anon$1@1f7f2e76
      at scala.Predef$.require(Predef.scala:224)
      at org.apache.carbondata.mv.plans.util.Printers$SQLFragmentCompactPrinter.printFragment(Printers.scala:248)
      at org.apache.carbondata.mv.plans.util.Printers$FragmentPrinter$$anonfun$print$1.apply(Printers.scala:82)
      at org.apache.carbondata.mv.plans.util.Printers$FragmentPrinter$$anonfun$print$1.apply(Printers.scala:80)
      at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35)
      at org.apache.carbondata.mv.plans.util.Printers$FragmentPrinter.print(Printers.scala:80)
      at org.apache.carbondata.mv.plans.util.Printers$class.render(Printers.scala:318)
      at org.apache.carbondata.mv.plans.modular.ModularPlan.render(ModularPlan.scala:35)
      at org.apache.carbondata.mv.plans.util.Printers$class.asCompactString(Printers.scala:323)
      at org.apache.carbondata.mv.plans.modular.ModularPlan.asCompactString(ModularPlan.scala:35)
      at org.apache.carbondata.mv.plans.modular.ModularPlan.asCompactSQL(ModularPlan.scala:156)
      at org.apache.carbondata.mv.datamap.MVAnalyzerRule.apply(MVAnalyzerRule.scala:83)
      at org.apache.carbondata.mv.datamap.MVAnalyzerRule.apply(MVAnalyzerRule.scala:43)
      at org.apache.spark.sql.hive.CarbonAnalyzer.execute(CarbonAnalyzer.scala:46)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            akashrn5 Akash R Nilugal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h
                3h

                Slack

                  Issue deployment