Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1836

Default length for Varchar in cast expressions should be changed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • Future
    • Execution - Data Types
    • None

    Description

      Current behavior:

      Specify length:
      > select cast(t1.colfam1.col1 as varchar(10)) from table1 t1;
      ------------

      EXPR$0

      ------------

      val1
      val21
      val26

      ------------

      Default length for varchar in a cast expression:
      > select cast(t1.colfam1.col1 as varchar) from table1 t1;
      ------------

      EXPR$0

      ------------

      v
      v
      v

      ------------

      When the length attribute is not specified with varchar, in a cast expression, Drill treats the default length to be 1.

      Postgres and SQL Server sets the default length to be 30 in such a scenario. The behavior for Drill must be modified to something similar.

      Attachments

        Activity

          People

            Unassigned Unassigned
            agirish Abhishek Girish
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: