Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6542

Non-keyed, non-windowed aggregation fails

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Problem
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      The following query produces an empty result:

        val data = List(
          (1L, 1, 1d, 1f, new BigDecimal("1"), "Hi"),
          (2L, 2, 2d, 2f, new BigDecimal("2"), "Hallo"),
          (3L, 2, 2d, 2f, new BigDecimal("2"), "Hello"),
          (4L, 5, 5d, 5f, new BigDecimal("5"), "Hello"),
          (7L, 3, 3d, 3f, new BigDecimal("3"), "Hello"),
          (8L, 3, 3d, 3f, new BigDecimal("3"), "Hello world"),
          (16L, 4, 4d, 4f, new BigDecimal("4"), "Hello world"))
      
        @Test
        def testMin(): Unit = {
          val env = StreamExecutionEnvironment.getExecutionEnvironment
          env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
          val tEnv = TableEnvironment.getTableEnvironment(env)
          StreamITCase.testResults = mutable.MutableList()
      
          val stream = env
            .fromCollection(data)
            .assignTimestampsAndWatermarks(new TimestampWithEqualWatermark())
          val table = stream.toTable(tEnv, 'rowtime.rowtime, 'int, 'double, 'float, 'bigdec, 'string)
          tEnv.registerTable("MyTable", table)
      
          val t = tEnv.sql("SELECT MIN(`int`) FROM MyTable")
      
          t.toRetractStream[Row].print()
        }
      

        Activity

        Hide
        twalthr Timo Walther added a comment -

        This might be a problem of my IDE. I have to check it again later.

        Show
        twalthr Timo Walther added a comment - This might be a problem of my IDE. I have to check it again later.
        Hide
        xccui Xingcan Cui added a comment -

        Hi Timo Walther, it also produces an empty result in my IDE.

        Show
        xccui Xingcan Cui added a comment - Hi Timo Walther , it also produces an empty result in my IDE.
        Hide
        xccui Xingcan Cui added a comment -

        Hi Timo Walther, maybe we forget to call env.execute()...

        Show
        xccui Xingcan Cui added a comment - Hi Timo Walther , maybe we forget to call env.execute()...
        Hide
        fhueske Fabian Hueske added a comment -

        Thanks for looking into this Xingcan Cui!
        I think you are right. When adding env.execute(), the query produces the correct result. I tested a couple more non-window, non-groupBy queries and all worked fine.

        I'll close this issue.

        Show
        fhueske Fabian Hueske added a comment - Thanks for looking into this Xingcan Cui ! I think you are right. When adding env.execute() , the query produces the correct result. I tested a couple more non-window, non-groupBy queries and all worked fine. I'll close this issue.
        Hide
        twalthr Timo Walther added a comment -

        Sorry for the confusion Xingcan Cui Fabian Hueske. It seems that I made the typical beginner mistake

        Show
        twalthr Timo Walther added a comment - Sorry for the confusion Xingcan Cui Fabian Hueske . It seems that I made the typical beginner mistake

          People

          • Assignee:
            xccui Xingcan Cui
            Reporter:
            twalthr Timo Walther
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development