[ 
https://issues.apache.org/jira/browse/PHOENIX-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Violette updated PHOENIX-902:
-----------------------------------

    Attachment: PHOENIX_902_1.patch

The code now  fails fast on ambiguous columns. Test case:

CREATE TABLE IF NOT EXISTS TEST.TEST_TABLE (
ID INTEGER 
,CF1.COL1 INTEGER
,CF2.COL1 INTEGER
CONSTRAINT pk PRIMARY KEY (ID));

less ~/test.csv
ID, COL1, COL1
1,2,3

python ./bin/psql.py -t TEST.TEST_TABLE -h in-line localhost ~/test.csv

java.sql.SQLException: Unable to resolve these column names to a single column 
family:
COL1
Available columns with column families:
ID,CF1.COL1,CF2.COL1
        at 
org.apache.phoenix.util.CSVCommonsLoader.generateColumnInfo(CSVCommonsLoader.java:369)
        at 
org.apache.phoenix.util.CSVCommonsLoader.buildColumnInfoList(CSVCommonsLoader.java:275)
        at 
org.apache.phoenix.util.CSVCommonsLoader.upsert(CSVCommonsLoader.java:223)
        at 
org.apache.phoenix.util.CSVCommonsLoader.upsert(CSVCommonsLoader.java:199)
        at org.apache.phoenix.util.PhoenixRuntime.main(PhoenixRuntime.java:208)


> Allow family qualified names in CSVCommonsLoader
> ------------------------------------------------
>
>                 Key: PHOENIX-902
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-902
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: James Violette
>             Fix For: 3.0.0
>
>         Attachments: PHOENIX_902_1.patch
>
>
> When using family-qualified names, the CSVCommonsLoader cannot find the 
> columns.  
> We can update the loader to create a family-qualified name map in addition to 
> the column name map.  When using table-defined columns, the loader would use 
> the family-qualified name map.  When using user-supplied columns, the loader 
> should first look into the family-qualified name map, then in the column name 
> map.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to