-
Notifications
You must be signed in to change notification settings - Fork 1
Massive Optional + Functions update #13
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
Conversation
1NepuNep1
commented
Sep 26, 2025
- Added almost all functions except ones working with containers
- Supported Options typedef
- CAST, LEAST (MIN_OF), GREATEST are covered like in PostgreSQL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive YDB function support and improvements to optional type handling. The update expands from a basic set of functions to nearly complete YDB function coverage including mathematical, string processing, datetime, and regular expression functions.
- Adds extensive function library covering mathematical operations, string processing, datetime manipulation, regular expressions, and specialized YDB functions
- Implements proper Optional typedef support with syntax handling for both
Optional<type>andtype?notations - Replaces the recursive function call AST node with standard function expression nodes for better compatibility
- Enhances type system with nullable type detection and proper Optional type extraction
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/sql/astutils/walk.go | Removes RecursiveFuncCall node handling from AST walker |
| internal/sql/astutils/rewrite.go | Removes RecursiveFuncCall node handling from AST rewriter |
| internal/sql/ast/recursive_func_call.go | Deletes the entire RecursiveFuncCall AST node definition |
| internal/engine/ydb/stdlib.go | Adds window and C++ function libraries to default schema |
| internal/engine/ydb/lib/window.go | Implements comprehensive window function support |
| internal/engine/ydb/lib/cpp/*.go | Adds extensive C++ function libraries for specialized operations |
| internal/engine/ydb/lib/cpp.go | Aggregates all C++ function libraries |
| internal/engine/ydb/lib/basic.go | Expands basic functions with proper type handling |
| internal/engine/ydb/lib/aggregate.go | Refactors aggregate functions with improved organization |
| internal/engine/ydb/convert.go | Enhances parser with Optional type support and CAST expressions |
| internal/codegen/golang/ydb_type.go | Adds Optional type extraction and nullable type detection |
| internal/codegen/golang/query.go | Updates parameter mapping to handle Optional types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
internal/codegen/golang/query.go
Outdated
| // ydbBuilderMethodForColumnType maps a YDB column data type to a ParamsBuilder method name. | ||
| func ydbBuilderMethodForColumnType(dbType string) string { | ||
| switch strings.ToLower(dbType) { | ||
| // Extract base type from Optional<T> types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот комментарий лучше перенести в описание метода extractBaseType