Uh oh!
There was an error while loading. Please reload this page.
ZEPPELIN-289: User can now enter custom expressions in notebooks' input fields - #320
ZEPPELIN-289: User can now enter custom expressions in notebooks' input fields#320rolmovel wants to merge 2 commits into
Conversation
…ut fields. Expression will be evaluated server-side by Zeppelin before being sent to the interpreter.
bzz
commented
Oct 6, 2015
Looks interesting, thank you for contributing! Please help me to understand, am I right that these changes potentially affect all interpreter's syntax and code-wise are not localised to your particular use-case with spark sql? |
lucarosellini
commented
Oct 6, 2015
Hi @bzz, |
bzz
commented
Jan 5, 2016
@lucarosellini thanks for the explanation! @rolmovel Could you merge latest master in to resolve conflicts as well as update |
corneadoug
commented
Sep 27, 2016
@rolmovel If this PRs is still needed, can we try to rebase it? |
felixcheung
commented
Nov 3, 2016
This looks to be an unique and important feature to have, will be great to have this in Zeppelin |
close#83close#86close#125close#133close#139close#146close#193close#203close#246close#262close#264close#273close#291close#299close#320close#347close#389close#413close#423close#543close#560close#658close#670close#728close#765close#777close#782close#783close#812close#822close#841close#843close#878close#884close#918close#989close#1076close#1135close#1187close#1231close#1304close#1316close#1361close#1385close#1390close#1414close#1422close#1425close#1447close#1458close#1466close#1485close#1492close#1495close#1497close#1536close#1545close#1561close#1577close#1600close#1603close#1678close#1695close#1739close#1748close#1765close#1767close#1776close#1783close#1799
Actually, with Zeppelin we can use Spark SQL UDFs perfectly fine.
We developed a custom UDF library that parses absolute and relative dates. Feeding this library into Spark SQL using the standard UDF mechanism is suboptimal, since each UDF call is repeated for each row of the queried table.
Example:
This repeats the call to parseDate(...) for every single row of 'my_table'.
Even worse, if we filter for a date range like in:
the call to parseDate(...) is performed twice for each row in the table.
Since Spark's UDFs do not have a concept of 'execution context' we were not able to overcome the problem.
We implemented a mechanism of UDF evaluation in Zeppelin, before the query parameters are sent to the interpreter. Parametrizing queries as usual in Zeppelin, in Zeppelin's input forms you can now enter expressions like:
or:
this is similar to how standard SQL works, where parameters are evaluated before being sent to the execution engine.
You can find more info in the org.apache.zeppelin.display.Evaluator javadoc.
The above mentioned query over a table of 1 million records lasts about 1 minute. Applying this PR the execution time is reduced to 15 seconds.