Evaluate how SQL interacts with Painless #50383
Labels
:Core/Infra/Scripting
Scripting abstractions, Painless, and Mustache
>enhancement
Team:Core/Infra
Meta label for core/infra team
In order to allow SQL to write to the Painless internal representation via an IR builder, we need to look at how parsed SQL interacts with Painless to get good API ideas.
Base class is
InternalSqlScriptUtils
registered insql_whitelist.txt
.We can check
QueryTranslatorTests
egtestChronoFieldBasedDateTimeFunctionsWithMathIntervalAndGroupBy
to get a sense of the script generation which takes place through theScriptWeaver
interface
.Every scalar function implements it's own script. For something like
SELECT f1(f2(f3(f4…..)
each function generates its portion of theScriptTemplate
which is passed to the next one in the chain resulting the the final script.The parser lives in
org.elasticsearch.xpack.sql.parser
,SqlParser
,ExpressionBuilder
.SqlBase.g4
is the antlr4 grammar.cc: @jdconrad @matriv
Related: #49869
The text was updated successfully, but these errors were encountered: