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 Thu, 10 Nov 2016 18:14:51 GMT
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<http://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