Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-30375 Feature Parity between PostgreSQL and Spark (implementation-dependent behaviours)
  3. SPARK-28121

String Functions: decode/encode can not accept 'escape' and 'hex' as charset

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      postgres=# select decode('1234567890','escape');
      decode
      ------------------------
      \x31323334353637383930
      (1 row)
      
      spark-sql> select decode('1234567890','escape');
      19/06/20 01:57:33 ERROR SparkSQLDriver: Failed in [select decode('1234567890','escape')]
      java.io.UnsupportedEncodingException: escape
      	at java.lang.StringCoding.decode(StringCoding.java:190)
      	at java.lang.String.<init>(String.java:426)
      	at java.lang.String.<init>(String.java:491)
      ...
      
      
      spark-sql> select decode('ff','hex');
      19/08/16 21:44:55 ERROR SparkSQLDriver: Failed in [select decode('ff','hex')]
      java.io.UnsupportedEncodingException: hex
      	at java.lang.StringCoding.decode(StringCoding.java:190)
      	at java.lang.String.<init>(String.java:426)
      	at java.lang.String.<init>(String.java:491)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: