Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
[SPARK-9400][SQL] removed unnecessary semicolon
  • Loading branch information
tarekbecker committed Jul 30, 2015
commit b737590f0175dcee974294eadcf4d174262114d9
Original file line number Diff line number Diff line change
Expand Up @@ -407,19 +407,19 @@ case class StringLocate(substr: Expression, str: Expression, start: Expression)
s"""
int ${ev.primitive} = 0;
boolean ${ev.isNull} = false;
${startGen.code};
${startGen.code}
if (!${startGen.isNull}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarekauel can we specialize code gen for cases where str / start is foldable?

Once you do that, make sure you update the test cases to use NonFoldableLiteral (just search the code base for how it is used).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not need the special case here, because we can directly call UTF8String.indexOf()

${substrGen.code};
${substrGen.code}
if (!${substrGen.isNull}) {
${strGen.code};
${strGen.code}
if (!${strGen.isNull}) {
${ev.primitive} = ${strGen.primitive}.indexOf(${substrGen.primitive},
${startGen.primitive}) + 1;
} else {
${ev.isNull} = true;;
${ev.isNull} = true;
}
} else {
${ev.isNull} = true;;
${ev.isNull} = true;
}
}
"""
Expand Down