hansott commented on code in PR #1677:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1677#discussion_r1928983817
##########
src/tokenizer.rs:
##########
@@ -1147,7 +1147,11 @@ impl<'a> Tokenizer<'a> {
s.push('.');
chars.next();
}
- s += &peeking_take_while(chars, |ch| ch.is_ascii_digit());
+
+ s += &peeking_take_while(chars, |ch| {
+ ch.is_ascii_digit()
+ ||
self.dialect.supports_numeric_literal_underscores() && ch == '_'
Review Comment:
What happens if starts or ends with `_`?
I think Clickhouse rejects that:
https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/StringUtils.h#L171-L182
##########
src/tokenizer.rs:
##########
@@ -1147,7 +1147,11 @@ impl<'a> Tokenizer<'a> {
s.push('.');
chars.next();
}
- s += &peeking_take_while(chars, |ch| ch.is_ascii_digit());
+
+ s += &peeking_take_while(chars, |ch| {
+ ch.is_ascii_digit()
+ ||
self.dialect.supports_numeric_literal_underscores() && ch == '_'
Review Comment:
What happens if starts or ends with `_`?
I think ClickHouse rejects that:
https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/StringUtils.h#L171-L182
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]