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

agg Query failed when non supported aggregate is present in Query

    XMLWordPrintableJSON

Details

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

    Description

      Run below Query where var_samp is not supported aggregate for aggregate table

      spark.sql(
      s"""create datamap preagg_sum on table tbl_1 using 'preaggregate' as select mac,avg(age) from tbl_1 group by mac"""

      .stripMargin)

      spark.sql("select var_samp(mac) from tbl_1 where mac='Mikaa1' ").explain()

      Exception :-
      Exception in thread "main" org.apache.spark.sql.AnalysisException: resolved attribute(s) mac#2 missing from tbl_1_mac#56,tbl_1_age_sum#57L,tbl_1_age_count#58L in operator !Aggregate var_samp(cast(mac#2 as double)) AS var_samp(CAST(mac AS DOUBLE))#59;;
      !Aggregate var_samp(cast(mac#2 as double)) AS var_samp(CAST(mac AS DOUBLE))#59
      +- Filter (tbl_1_mac#56 = Mikaa1)
      +- Relationtbl_1_mac#56,tbl_1_age_sum#57L,tbl_1_age_count#58L CarbonDatasourceHadoopRelation [ Database name :default, Table name :tbl_1_preagg_sum, Schema :Some(StructType(StructField(tbl_1_mac,StringType,true), StructField(tbl_1_age_sum,LongType,true), StructField(tbl_1_age_count,LongType,true))) ]

      Attachments

        Issue Links

          Activity

            People

              Bjangir Babulal
              Bjangir Babulal
              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 - 1.5h
                  1.5h