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

SQLContext doesn't handle tricky column names when loading from JDBC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.4.0
    • None
    • SQL
    • None
    • Ubuntu 14.04, Sqlite 3.8.7, Spark 1.4.0

    Description

      Reproduce:

      • create a table in a relational database (in my case sqlite) with a column name containing a space:
        CREATE TABLE my_table (id INTEGER, "tricky column" TEXT);
      • try to create a DataFrame using that table:
        sqlContext.read.format("jdbc").options(Map(
        "url" -> "jdbs:sqlite:...",
        "dbtable" -> "my_table")).load()

      java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such column: tricky)

      According to the SQL spec this should be valid:
      http://savage.net.au/SQL/sql-99.bnf.html#delimited%20identifier

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gsvigruha Gergely Svigruha
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: