phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Long, Xindian" <>
Subject RE: Phoenix-Spark plug in cannot select by column family name
Date Wed, 23 Nov 2016 17:55:51 GMT
Thanks, I just filed a Jira Issue


From: James Taylor []
Sent: Thursday, November 10, 2016 3:08 PM
To: user
Subject: Re: Phoenix-Spark plug in cannot select by column family name

Please file a JIRA, though, Xindian. It's a reasonable request to add the ability to prefix
column references with the column family name just like you can do in JDBC.

On Thu, Nov 10, 2016 at 12:05 PM, Chris Tarnas <<>>
From my experience you will need to make sure that the column names are unique, even across
families, otherwise Spark will throw errors.

Chris Tarnas
Biotique Systems, Inc<>

On Nov 10, 2016, at 10:14 AM, Long, Xindian <<>>

It works with no column family, but I expect that I do not need to make sure column names
are unique  across different column families.


From: James Taylor []
Sent: Tuesday, November 08, 2016 5:46 PM
To: user
Subject: Re: Phoenix-Spark plug in cannot select by column family name

Have you tried without the column family name? Unless the column names are not unique across
all column families, you don't need to include the column family name.


On Tue, Nov 8, 2016 at 2:19 PM, Long, Xindian <<>>
I have a table with multiple column family with possible same column names.
I want to use phoenix-spark plug in to select some of the fields, but it returns a AnalysisException
(details in the attached file)

public void testSpark(JavaSparkContext sc, String tableStr, String dataSrcUrl) {
    //SparkContextBuilder.buildSparkContext("Simple Application", "local");

    // One JVM can only have one Spark Context now
    Map<String, String> options = new HashMap<String, String>();
    SQLContext sqlContext = new SQLContext(sc);

    options.put("zkUrl", dataSrcUrl);
    options.put("table", tableStr);"Phoenix DB URL: " + dataSrcUrl + " tableStr: " + tableStr);

    DataFrame df = null;
    try {
        df ="org.apache.phoenix.spark").options(options).load();

        df ="I.CI<>", "I.FA");

        //df ="\"I\".\"CI\"", "\"I\".\"FA\""); // This gives the same exception

    } catch (Exception ex) {
        log.error("sql error: ", ex);

    try {"Count By phoenix spark plugin: " + df.count());
   } catch (Exception ex) {
        log.error("dataframe error: ", ex);


I can see in the log that there is something like

10728 [INFO] main  org.apache.phoenix.mapreduce.PhoenixInputFormat  - Select Statement: SELECT

But obviously, the column family is  left out of the Dataframe column name somewhere in the
Any fix for the problem?



View raw message