Filtering from phoenix when loading a table

穿精又带淫゛_ 提交于 2019-12-14 01:40:47

问题


I would like to know how this exactly works,

df = sqlContext.read \
          .format("org.apache.phoenix.spark") \
          .option("table", "TABLE") \
          .option("zkUrl", "10.0.0.11:2181:/hbase-unsecure") \
          .load()

if this is loading the whole table or it will delay the loading to know if a filtering will be applied.

In the first case, how is the way to tell phoenix to filter the table before loading in the spark dataframe?

Thanks


回答1:


Data is not loaded until you execute an action which requires it. All filter applied in the middle:

df.where($"foo" === "bar").count

will be pushed down by Spark if it is possible. You can watch results of predicate pushdown by running explain()



来源:https://stackoverflow.com/questions/40870475/filtering-from-phoenix-when-loading-a-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!