Uploaded image for project: 'Apache MADlib'
  1. Apache MADlib
  2. MADLIB-1186

Correlation query fails with international chars in column name

    XMLWordPrintableJSON

Details

    Description

      We tried running the correlation module in MADlib, on a table that had
      international characters for schema, and column name of one of the
      independent variables. It resulted in the following error:

      select
            madlib.correlation(
                '"nåmespace"."dt_gOlf"',
                '"__madlib_temp_26728701_1513000192_9340672___πøA"',
                'id, temperature, "Humidity"');
      psql:/tmp/build/60928da1/madlib_testsuite/tests/Correlation/sql_CorrelationInternationalCharOutputTestCase/test_correlation_international_char.sql:12: ERROR:  spiexceptions.SyntaxError: syntax error at or near ""Humidity""
      LINE 10: ...rature, avg_temperature),coalesce("Humidity", avg_"Humidity"...
                                                                    ^
      QUERY:
      
                  CREATE TEMP TABLE __madlib_temp_43456465_1513000195_75531635__ AS
                  SELECT
                      count(*) AS tot_cnt,
                      mean,
                      madlib.correlation_agg(x, mean) as cor_mat
                  FROM
                  (
                      SELECT ARRAY[ coalesce(id, avg_id),coalesce(temperature, avg_temperature),coalesce("Humidity", avg_"Humidity") ] AS x,
                              ARRAY [ avg_id,avg_temperature,avg_"Humidity" ] AS mean
                      FROM "nåmespace"."dt_gOlf",
                      (
                          SELECT avg(id) AS avg_id,avg(temperature) AS avg_temperature,avg("Humidity") AS avg_"Humidity"
                          FROM "nåmespace"."dt_gOlf"
                      )sub1
                  ) sub2
                  GROUP BY mean
      
      CONTEXT:  Traceback (most recent call last):
        PL/Python function "correlation", line 23, in <module>
          return correlation.correlation(**globals())
        PL/Python function "correlation", line 71, in correlation
        PL/Python function "correlation", line 205, in _populate_output_table
      PL/Python function "correlation"
            select * from "__madlib_temp_26728701_1513000192_9340672___πøA" order by column_position;
      

      Attachments

        Issue Links

          Activity

            People

              ssoni ssoni
              njayaram Nandish Jayaram
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: