Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tokenizing the path by dot #109

Merged
merged 1 commit into from
Jan 9, 2023
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
7 changes: 5 additions & 2 deletions velox/type/Tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ std::unique_ptr<Subfield::PathElement> Tokenizer::computeNext() {
return nullptr;
}

// No need to tokenizing the path by dot because Spark treats dot as regular character.
/*
if (tryMatch(DOT)) {
std::unique_ptr<Subfield::PathElement> token = matchPathSegment();
firstSegment = false;
return token;
}
}*/

if (tryMatch(OPEN_BRACKET)) {
std::unique_ptr<Subfield::PathElement> token = tryMatch(QUOTE)
Expand Down Expand Up @@ -144,8 +146,9 @@ std::unique_ptr<Subfield::PathElement> Tokenizer::matchUnquotedSubscript() {
}

bool Tokenizer::isUnquotedPathCharacter(char c) {
// Add dot here because Spark treats dot as regular character.
return c == ':' || c == '$' || c == '-' || c == '/' || c == '@' || c == '|' ||
c == '#' || isUnquotedSubscriptCharacter(c);
c == '#' || c == '.' || isUnquotedSubscriptCharacter(c);
}

bool Tokenizer::isUnquotedSubscriptCharacter(char c) {
Expand Down