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

Unified the max display column width for SqlClient and Table APi in both Streaming and Batch execMode

    XMLWordPrintableJSON

Details

    Description

      FLIP-279 https://cwiki.apache.org/confluence/display/FLINK/FLIP-279+Unified+the+max+display+column+width+for+SqlClient+and+Table+APi+in+both+Streaming+and+Batch+execMode

       

      Background info:

      table.execute().print() can only use the default max column width. When running table API program "table.execute().print();", the columns with long string value are truncated to 30 chars. E.g.,:

      I tried set the max width with: tEnv.getConfig.getConfiguration.setInteger("sql-client.display.max-column-width", 100); It has no effect.  How can I set the max-width?

      Here is the example code:

      val env = StreamExecutionEnvironment.getExecutionEnvironment
      val tEnv = StreamTableEnvironment.create(env)

      tEnv.getConfig.getConfiguration.setInteger("sql-client.display.max-column-width", 100)

      val orderA = env
        .fromCollection(Seq(Order(1L, "beer", 3), Order(1L, "diaper-{}.diaper{}.diaper{}.diaper{}-.", 4), Order(3L, "rubber", 2)))
        .toTable(tEnv)

      orderA.execute().print()

       

      "sql-client.display.max-column-width" seems only work in cli: SET 'sql-client.display.max-column-width' = '40';

      While using Table API, by default, the DEFAULT_MAX_COLUMN_WIDTH in PrintStyle is used now. It should be configurable. 

      Attachments

        Issue Links

          Activity

            People

              jingge Jing Ge
              jingge Jing Ge
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: