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

Failed to resolve the where condition #101

Closed
Scholar-Li opened this issue Sep 24, 2024 · 1 comment · Fixed by #102
Closed

Failed to resolve the where condition #101

Scholar-Li opened this issue Sep 24, 2024 · 1 comment · Fixed by #102

Comments

@Scholar-Li
Copy link

	query = `select date, path, splitByChar('/', path)[2] as path_b
from(
	select 'pathA/pathB/pathC' as path, '2024-09-10' as date
) 
where toDate(date) = '2024-09-01' and '2024-09-30'
and splitByChar('/', path)[1] = 'pathA'`
	parser := clickhouse.NewParser(strings.TrimSpace(query))

	// Parse query into AST
	statements, err := parser.ParseStmts()
	if err != nil {
		panic(err.Error())
	}

Both where conditions will report errors.

 [recovered]
	panic: line 4:19 <EOF> or ';' was expected, but got: "between"
where toDate(date) between '2024-09-01' and '2024-09-30'
 [recovered]
	panic: line 5:30 <EOF> or ';' was expected, but got: "="
and splitByChar('/', path)[1] = 'pathA'
@git-hulk
Copy link
Member

@Scholar-Li Thanks for your report, will fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants