You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: A field of output. You can specify zero or multiple <outputField>. If you specify <outputField> with an existing field name in source query, its values will be replaced or appended by matched values from <inputField>. If the field specified in <outputField> is a new field, in REPLACE strategy, an extended new field will be applied to the results, but fail in APPEND strategy.
Demo
fact table
id
col1
col2
1
a
b
2
aa
bb
3
null
ccc
dimension table
id
col1
col3
1
x
y
3
xx
yy
Replace lookup table field to a new output field:
Q1: source=fact | lookup dim id REPLACE col1 as colA
An extended new field colA will be applied to the results
id
col1
col2
colA
1
a
b
x
2
aa
bb
null
3
null
ccc
xx
Append lookup table field to a new output field:
Q2: source=fact | lookup dim id APPEND col1 as colA
Throws with "A column or function parameter with name colA cannot be resolved"
Actually, as the colA is a new field which not existed in fact and dim, the Q2 could be rewritten by Q1.
More complexity, for query
Q3: source=fact | lookup dim id APPEND col1, col3 as colA
could be rewritten to
Q4: source=fact | lookup dim id APPEND col1 | lookup dim id REPLACE col3 as colA
What solution would you like?
The failure is because the current implementation Coalesce expression cannot be resolved with a not existed attribute. To resolve the failure of query Q2 and Q3, we have to extract the output attributes from source plan (not source table).
What alternatives have you considered?
Keep throwing failure since the failed Q2 and Q3 can be rewritten to Q1 and Q4.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
In docs/ppl-lang/ppl-lookup-command.md
Demo
Replace lookup table field to a new output field:
An extended new field
colA
will be applied to the resultsAppend lookup table field to a new output field:
Throws with "A column or function parameter with name
colA
cannot be resolved"Actually, as the
colA
is a new field which not existed infact
anddim
, the Q2 could be rewritten by Q1.More complexity, for query
could be rewritten to
What solution would you like?
The failure is because the current implementation
Coalesce
expression cannot be resolved with a not existed attribute. To resolve the failure of query Q2 and Q3, we have to extract the output attributes from source plan (not source table).What alternatives have you considered?
Keep throwing failure since the failed Q2 and Q3 can be rewritten to Q1 and Q4.
The text was updated successfully, but these errors were encountered: