Uploaded image for project: 'Teiid Designer'
  1. Teiid Designer
  2. TEIIDDES-2913

Special characters in column names when importing CSV files

    Details

    • Steps to Reproduce:
      Hide

      I reproduce this problem every time.

      To create the default server:

      1) new server
      2) localhost -> name the server -> next
      3) create new runtime -> next
      4) name the runtime -> browse the teiid home dir -> execution env java 1.8 -> standalone -> standalone.xml -> next
      5) finish

      Start the server

      To import the failure-inducing data:

      1) Create a simple csv file, e.g.:

      "a b","cd","xpto 123","x"
      1,2,3,4
      5,6,7,8

      2) Create a new Model Project
      3) In sources folder, import -> File Source (Flat) -> next
      4) Flat file on local file system -> next
      5) New File source -> name it -> next -> enter file url -> select the csv file created and leave the rest with the defaults (UTF-8; CSV; use first line... checked) -> Test Connection -> next -> finish
      6) name the source model -> next
      7) name the jndi -> next
      8) keep the defaults (character delimited) -> next
      9) keep the defaults (HL# 1; DL# 2, comma as the delimiter; selected file only) -> next
      10) name the view model and table -> finish
      11) save all
      12) sources-> view_model_name -> table_name (select the table)
      13) Preview Data
      14) ok

      I get an error message immediately and the console displays the above-exposed exception.

      Show
      I reproduce this problem every time. To create the default server: 1) new server 2) localhost -> name the server -> next 3) create new runtime -> next 4) name the runtime -> browse the teiid home dir -> execution env java 1.8 -> standalone -> standalone.xml -> next 5) finish Start the server To import the failure-inducing data: 1) Create a simple csv file, e.g.: "a b","cd","xpto 123","x" 1,2,3,4 5,6,7,8 2) Create a new Model Project 3) In sources folder, import -> File Source (Flat) -> next 4) Flat file on local file system -> next 5) New File source -> name it -> next -> enter file url -> select the csv file created and leave the rest with the defaults (UTF-8; CSV; use first line... checked) -> Test Connection -> next -> finish 6) name the source model -> next 7) name the jndi -> next 8) keep the defaults (character delimited) -> next 9) keep the defaults (HL# 1; DL# 2, comma as the delimiter; selected file only) -> next 10) name the view model and table -> finish 11) save all 12) sources-> view_model_name -> table_name (select the table) 13) Preview Data 14) ok I get an error message immediately and the console displays the above-exposed exception.

      Description

      Hi,

      I've been dwelling with this problem for quite some time and still can't figure out what is wrong, can you help me out (thanks in advance)? Every time I import a CSV file with TEIID designer, in which the column names contain anything that is not a letter/number/underscore (e.g. a white space), I get the following exception when attempting to preview data:

      Was expecting: "string" | "varbinary" | "varchar" | "boolean" | "byte" | "tinyint" | "short" | "smallint" | "char" | "integer" ...: org.teiid.metadata.ParseException: TEIID30386 org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered "new_table ( a [*]b[*] string(" at line 3, column 11.
      Was expecting: "string" | "varbinary" | "varchar" | "boolean" | "byte" | "tinyint" | "short" | "smallint" | "char" | "integer" ...
      at org.teiid.query.parser.QueryParser.parseDDL(QueryParser.java:472)
      at org.teiid.metadata.MetadataFactory.parse(MetadataFactory.java:776)
      at org.teiid.query.metadata.DDLMetadataRepository.loadMetadata(DDLMetadataRepository.java:40)
      at org.teiid.runtime.AbstractVDBDeployer$MetadataRepositoryWrapper.loadMetadata(AbstractVDBDeployer.java:84)
      at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
      at org.teiid.jboss.VDBService$6.run(VDBService.java:398)
      at org.teiid.jboss.VDBService$7.run(VDBService.java:449)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered "new_table ( a [*]b[*] string(" at line 3, column 11.
      Was expecting: "string" | "varbinary" | "varchar" | "boolean" | "byte" | "tinyint" | "short" | "smallint" | "char" | "integer" ...
      at org.teiid.query.parser.QueryParser.convertParserException(QueryParser.java:214)
      ... 13 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                blafond Barry LaFond
                Reporter:
                jmatos João Matos
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: