Skip to content

Commit 3e6e9f5

Browse files
authored
Revert "Support single line comments starting with '#' for Hive (apache#1654)"
This reverts commit 6ca5e9e.
1 parent c7285be commit 3e6e9f5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/tokenizer.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ use serde::{Deserialize, Serialize};
4040
#[cfg(feature = "visitor")]
4141
use sqlparser_derive::{Visit, VisitMut};
4242

43+
use crate::ast::DollarQuotedString;
4344
use crate::dialect::Dialect;
4445
use crate::dialect::{
4546
BigQueryDialect, DuckDbDialect, GenericDialect, MySqlDialect, PostgreSqlDialect,
4647
SnowflakeDialect,
4748
};
4849
use crate::keywords::{Keyword, ALL_KEYWORDS, ALL_KEYWORDS_INDEX};
49-
use crate::{ast::DollarQuotedString, dialect::HiveDialect};
5050

5151
/// SQL Token enumeration
5252
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
@@ -1372,8 +1372,7 @@ impl<'a> Tokenizer<'a> {
13721372
}
13731373
'{' => self.consume_and_return(chars, Token::LBrace),
13741374
'}' => self.consume_and_return(chars, Token::RBrace),
1375-
'#' if dialect_of!(self is SnowflakeDialect | BigQueryDialect | MySqlDialect | HiveDialect) =>
1376-
{
1375+
'#' if dialect_of!(self is SnowflakeDialect | BigQueryDialect | MySqlDialect) => {
13771376
chars.next(); // consume the '#', starting a snowflake single-line comment
13781377
let comment = self.tokenize_single_line_comment(chars);
13791378
Ok(Some(Token::Whitespace(Whitespace::SingleLineComment {

tests/sqlparser_common.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10423,7 +10423,6 @@ fn test_comment_hash_syntax() {
1042310423
Box::new(BigQueryDialect {}),
1042410424
Box::new(SnowflakeDialect {}),
1042510425
Box::new(MySqlDialect {}),
10426-
Box::new(HiveDialect {}),
1042710426
]);
1042810427
let sql = r#"
1042910428
# comment

0 commit comments

Comments
 (0)