2016-01-11 62 views
0

我想知道phoenix中where子句的完整生命週期。 條件的值如何從不同的類和中間值進行解析。 where子句邏輯和掃描對象究竟在哪裏駐留代碼解析phoenix中的where子句

執行命令 從「table_name」中select ID,NAME where salary> = 45678; 或 從「table_name」中選擇ID,SALARY,其中名稱如'%abcd%'; 是他們的一種參考。 thanx提前。

回答

0

你可以看看WhereCompiler.compile(...)在QueryCompiler.compileSingleFlatQuery()函數

通常跟蹤正常選擇查詢路徑是: -

PhoenixStatement.executeQuery() -> ExecutableSelectStatement.compilePlan() -> 
QueryCompiler.compile() -> compileSelect() -> compileSingleQuery()-> 
compileSingleFlatQuery() 

掃描是在上下文中設置並從各種編譯器和迭代器移動到正確設置。您可以查找掃描中推送過濾器的WhereCompiler代碼。