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

scala package class case class on flink sql

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.11.1
    • Fix Version/s: None
    • Component/s: API / Scala
    • Labels:
    • Environment:

      flink version: 1.11.1

      scala version: 2.12

    • Flags:
      Important
    • Docs Text:
      After many tests, the problem can be reproduced stably, I initially think it is a problem of scala case class on package object.

      Description

      When I use Flink SQL scala API, I found a bug. I have a sensor.txt, the txt file has some sensor data.One row of data is as follows:

      sensor_1,1547718199,35.8
      

      And I have a `package object MyTest` class. This class has a case class `SensorReading`.

      package object MyTest {
          case class SensorReading(id: String, timestamp: Long, temperature: Double)
      }
      

      When I use Flink SQL API, I think he should output the correct result, but he reported an error.

      tEnv.createTemporaryView("ds", dataStream)
      val result: Table = tEnv.sqlQuery("SELECT * FROM ds where `temperature` >= 5")
      result.toAppendStream[SensorReading].print("test")

      I will send you the error as a file later. And I found Inner class and scala General class not send this error.
      If you have any findings, please contact me.

        Attachments

        1. error.txt
          21 kB
          Yanzhao Deng
        2. NewApiTest.scala
          1 kB
          Yanzhao Deng
        3. package.scala
          0.2 kB
          Yanzhao Deng

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dyzcs Yanzhao Deng
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

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