Hi, I'm trying to run a few queries using Python's...
# general
m
Hi, I'm trying to run a few queries using Python's
Pinotdb
client version
0.4.5
but it doesn't seem to be working when the query has an alias. Here are a few queries (tried other cases as well) I've tried: "SELECT "tbl1"."x" FROM "y" "tbl1"" , "SELECT "tbl1"."x" FROM "y" AS "tbl1"". Has anyone encountered this issue? Is this a known limitation?
s
Hi Marco, can you post the code example?
the above has some code example with
AS
statement
By the way, from your example, I guess that you are trying
alias table
. We don't support it. We only support
alias column
.
m
Thanks @Seunghyun, I was referencing the same guide you posted. Is there a plan to support
table alias
? Our queries have a lot of table aliases and we're planning to execute them directly in Pinot.
s
Pinot handles one query independently. Once we add to support sub-queries, it may make sense to support it. May I ask your usecase for the need for
table alias
?
m
There are several cases: sub-queries like you mentioned, leveraging aliases when using the join feature: https://docs.pinot.apache.org/developers/advanced/v2-multi-stage-query-engine e.g if I need to do some computation such as add the value of two columns from different tables e.g "tbl1"."x" + "tbl2".y". We need the alias here in case "tbl1" also has a column
y
.
@Seunghyun: It looks like the v2 engine already has support for table alias. When I run a query directly in the Pinot UI and enable the v2 engine, table aliasing works. Would you suggest creating an issue to support these from the client?
s
V2 is something that we are actively developing but I don't think that it's yet to be at the level of being used at the production. Anyway, let's create the issue in the git repository for
pinotdb
to open up the API to hit v2 engine. Once that's wired, we can use v2 engine using
pinotdb
. If you want to try out the V2 engine, you can build and run Pinot from the recent master's branch.
👍 1
m
Thanks @Seunghyun, we already have the latest branch and we've been testing the v2 engine and want to route our queries directly to Pinot. I've opened this issue: https://github.com/apache/pinot/issues/9845
s
Since it's a different code repository 🙂
m
n
@Rong R fyi ^