Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-29854

lpad and rpad built in function not throw Exception for invalid len value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      Spark Returns Empty String)

      0: jdbc:hive2://10.18.19.208:23040/default> SELECT lpad('hihhhhhhhhhhhhhhhhhhhhhhh', 500000000000000000000000, '????????????');
       +----------------------------------------------------+
      |lpad(hihhhhhhhhhhhhhhhhhhhhhhh, CAST(500000000000000000000000 AS INT), ????????????)|
      
      +----------------------------------------------------+
      
      
      +----------------------------------------------------+
      
      
      Hive:
      
      
      SELECT lpad('hihhhhhhhhhhhhhhhhhhhhhhh', 500000000000000000000000, '????????????');
       Error: Error while compiling statement: FAILED: SemanticException [Error 10016]: Line 1:67 Argument type mismatch ''????????????'': lpad only takes INT/SHORT/BYTE types as 2-ths argument, got DECIMAL (state=42000,code=10016)
      
      
      PostgreSQL
      
      
      function lpad(unknown, numeric, unknown) does not exist
      
      
       
      
      Expected output:
      
      In Spark also it should throw Exception like Hive
      

       

      Attachments

        Activity

          People

            maropu Takeshi Yamamuro
            abhishek.akg ABHISHEK KUMAR GUPTA
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: