Massive Optional + Functions update#13
Merged
1NepuNep1 merged 4 commits intoydb-platform:ydbfrom Sep 26, 2025
Merged
Conversation
Collaborator
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.
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>
kprokopenko
approved these changes
Sep 26, 2025
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.
Этот комментарий лучше перенести в описание метода extractBaseType
asmyasnikov
pushed a commit
that referenced
this pull request
Dec 28, 2025
* Massive Functions update * Fixed ydb_type nullable problem and added new funcs to ydb catalog * Update internal/engine/ydb/convert.go * Removed comment from query.go to extractBaseType method
asmyasnikov
pushed a commit
that referenced
this pull request
Jan 10, 2026
* Massive Functions update * Fixed ydb_type nullable problem and added new funcs to ydb catalog * Update internal/engine/ydb/convert.go * Removed comment from query.go to extractBaseType method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.