Skip to content

Conversation

@1NepuNep1
Copy link
Collaborator

  • Added almost all functions except ones working with containers
  • Supported Options typedef
  • CAST, LEAST (MIN_OF), GREATEST are covered like in PostgreSQL
@1NepuNep1 1NepuNep1 requested a review from Copilot September 26, 2025 14:28
Copy link

Copilot AI left a 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> and type? 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>
// 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот комментарий лучше перенести в описание метода extractBaseType

@1NepuNep1 1NepuNep1 merged commit a680b1b into ydb-platform:ydb Sep 26, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants