"ingestionConfig": { "transformConfigs": [{ ...
# troubleshooting
s
"ingestionConfig": { "transformConfigs": [{ "columnName": "visits_case", "transformFunction": "Groovy((CASE WHEN visits = 1 and (first_tab = 'true' or first_tab = 'null') then 1 else 0 end), visits_case)" } }
n
Also you're using first_tab but it's not being passed as argument
s
U mean in transformation function, shall I pass both visits and first_tab as well ?
n
Is first tab one of the Pinot columns? Is yes, then yes you need to pass both
s
Copy code
{
  "code": 400,
  "error": "Invalid transform function 'Groovy((CASE WHEN visits = 1 and (first_tab = 'true' or first_tab = 'null') then 1 else 0 end), visits, first_tab)' for column 'visits_case'"
}
i m getting exception still
n
The syntax is still incorrect, look at the doc I sent
Eg Groovy({arg1+arg2}, arg1, arg2)
s
"ingestionConfig": { "transformConfigs": [{ "columnName": "visits_case", "transformFunction": "Groovy({(CASE WHEN visits = 1 and (first_tab = 'true' or first_tab = 'null') then 1 else 0 end)}, visits, first_tab)" }, { "columnName": "isbounce_case", "transformFunction": "Groovy({(case when isbounce = 'true' then 1 else 0 end)}, isbounce)" }, { "columnName": "isunique_case", "transformFunction": "Groovy({(case when isunique = 'true' then 1 else 0 end)}, isunique)" }, { "columnName": "isendandisbounce_case", "transformFunction": "Groovy({(case when isbounce = 'true' and eventnumber = 1 then 1 else 0 end)}, isend,isbounce)" }, { "columnName": "isend_case", "transformFunction": "Groovy({(case when isend = 'true' then 1 else 0 end)}, isend)" }, { "columnName": "eventnumber_case", "transformFunction": "Groovy({(case when eventnumber = 1 then 1 else 0 end)}, eventnumber)" }] },
is this fine?
not sure, how to include CASE inside groovy function
fixed it
thanks
working
n
awesome