Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-867][FOLLOWUP] Add substring_index function support #898

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[followup] support substring_index
  • Loading branch information
jackylee-ch committed May 5, 2022
commit f70f1b23d95ec5dc594fc77bd2302d10187bf661
Original file line number Diff line number Diff line change
@@ -161,6 +161,23 @@ object ColumnarExpressionConverter extends Logging {
attributeSeq,
convertBoundRefToAttrRef = convertBoundRefToAttrRef),
expr)
case ssi: SubstringIndex =>
check_if_no_calculation = false
logInfo(s"${expr.getClass} ${expr} is supported, no_cal is $check_if_no_calculation.")
ColumnarTernaryOperator.create(
replaceWithColumnarExpression(
ssi.strExpr,
attributeSeq,
convertBoundRefToAttrRef = convertBoundRefToAttrRef),
replaceWithColumnarExpression(
ssi.delimExpr,
attributeSeq,
convertBoundRefToAttrRef = convertBoundRefToAttrRef),
replaceWithColumnarExpression(
ssi.countExpr,
attributeSeq,
convertBoundRefToAttrRef = convertBoundRefToAttrRef),
expr)
case sr: StringRegexExpression =>
check_if_no_calculation = false
logInfo(s"${expr.getClass} ${expr} is supported, no_cal is $check_if_no_calculation.")
@@ -437,7 +454,7 @@ object ColumnarExpressionConverter extends Logging {
case regexp: RegExpReplace =>
containsSubquery(regexp.subject) || containsSubquery(
regexp.regexp) || containsSubquery(regexp.rep) || containsSubquery(regexp.pos)
case substrIndex: ColumnarSubstringIndex =>
case substrIndex: SubstringIndex =>
substrIndex.children.map(containsSubquery).exists(_ == true)
case sr: StringReplace =>
containsSubquery(sr.srcExpr) ||