Skip to content

Configurable Query #459

Answered by wangxiaoying
kepplertreet asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kepplertreet , currently this is the only way for us to automatically do the query partitioning. But you can manually specified the partitioned query by giving a list of sql queries, like this example:

import connectorx as cx

postgres_url = "postgresql://username:password@server:port/database"

# a list of queries that result in the same schema, connectorx will issue them in parallel and concat their result
queries = ["SELECT * FROM lineitem WHERE PARTITION_FILTER_0",
...,
"SELECT * FROM lineitem WHERE PARTITION_FILTER_N"]

df = cx.read_sql(postgres_url, queries)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kepplertreet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants