You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Josh Mahonin (JIRA)" <ji...@apache.org> on 2015/11/19 16:30:10 UTC
[jira] [Commented] (PHOENIX-2435) Where clause does not work for
phoenix-spark create phoenix RDD
[ https://issues.apache.org/jira/browse/PHOENIX-2435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013701#comment-15013701 ]
Josh Mahonin commented on PHOENIX-2435:
---------------------------------------
Hi [~diego.fustes]
Can you post the code you're trying to use? As well, the integration tests might be a good reference for further development:
https://github.com/apache/phoenix/blob/master/phoenix-spark/src/it/scala/org/apache/phoenix/spark/PhoenixSparkIT.scala
When using RDDs, in order to use a 'where' clause, you must pass in a 'predicate' value in your 'phoenixTableAsRDD' call. If you are using DataFrames, this should happen automatically, though if you start using them I recommend upgrading your Phoenix version if possible, there have been a lot of patches in that area.
I suspect you'll be able to execute your query using the following code:
{code}
val url = Some("localhost:2181") // replace with phoenix url here
val pred = s"RN = 'TUBFL04M0'"
val rdd = sc.phoenixTableAsRDD(
"SHOT",
Seq("RN,"ODO","GSN","ANG","MFL"),
predicate = Some(pred),
zkUrl = Some(url))
{code}
> Where clause does not work for phoenix-spark create phoenix RDD
> ---------------------------------------------------------------
>
> Key: PHOENIX-2435
> URL: https://issues.apache.org/jira/browse/PHOENIX-2435
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.4.0
> Reporter: Diego Fustes Villadóniga
>
> I create a phoenix RDD by passing the next query:
> SELECT RN,ODO,GSN,ANG,MFL FROM SHOT WHERE RN = 'TUBFL04M0'
> It seems that the where clause is not taking effect and all rows are readed into the RDD
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)