From ed6f4057b90c91275bcce5a125b0836e60ab4e8d Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 12 Sep 2022 10:37:34 -0300 Subject: [PATCH] Update .proto files to the same version that Arrow is using (#181) * update to v0.6 * .proto file modifications needed to compile with nanopb + generate R wrapper * with compiling nanopb-generated stuff! * update the generated types file * fix accidental renames from regex * update the ReadRel to use updated syntax * maybe try actions update with new duckdb release * typo * with working duckdb + substrait * slightly simpler * substrait_project -> substrait_select * first stab at "project" the right way * with everything except the Emit * with at least the project tests passing * don't include emit clause if it isn't needed * fix output type * simplify duckdb interfaces * fix output type on functions, use of arguments in functions, skip arrow for now because of the Emit clause thing * fix more failing tests * clean CMD check issues * disable arrow on CI until we actually use it to test things * maybe fix CMD check action --- .github/workflows/R-CMD-check.yaml | 91 +- .github/workflows/test-coverage.yaml | 17 +- DESCRIPTION | 4 +- NAMESPACE | 3 +- R/aggregate-rel.R | 4 +- R/compiler.R | 18 +- R/example_data.R | 43 +- R/filter-rel.R | 2 +- R/pkg-arrow.R | 3 +- R/pkg-dplyr.R | 20 +- R/pkg-duckdb.R | 227 +- R/project-rel.R | 101 +- R/sort-rel.R | 2 +- R/types-generated.R | 1502 ++++++---- R/util.R | 15 +- _pkgdown.yml | 2 +- data-raw/example_data.R | 37 + data-raw/update-substrait.R | 65 +- inst/substrait/CHANGELOG.md | 84 + inst/substrait/CONTRIBUTING.md | 17 + inst/substrait/LICENSE | 27 - inst/substrait/buf.gen.yaml | 12 +- inst/substrait/ci/commit_messages.sh | 17 + inst/substrait/ci/release/dry_run.sh | 43 + inst/substrait/ci/release/prepare.sh | 8 + inst/substrait/ci/release/publish.sh | 8 + inst/substrait/ci/release/run.sh | 15 + inst/substrait/ci/release/verify.sh | 6 + .../functions_aggregate_approx.yaml | 17 + .../functions_aggregate_generic.yaml | 10 + .../extensions/functions_arithmetic.yaml | 88 +- .../functions_arithmetic_decimal.yaml | 47 +- .../extensions/functions_boolean.yaml | 21 +- inst/substrait/extensions/functions_cast.yaml | 11 + .../extensions/functions_comparison.yaml | 55 +- .../extensions/functions_datetime.yaml | 96 + .../extensions/functions_string.yaml | 151 +- inst/substrait/proto/buf.yaml | 2 +- inst/substrait/proto/substrait/algebra.proto | 893 ++++++ inst/substrait/proto/substrait/any.proto | 4 + .../proto/substrait/capabilities.proto | 5 +- .../proto/substrait/expression.proto | 372 --- .../substrait/extensions/extensions.proto | 6 +- inst/substrait/proto/substrait/function.proto | 12 +- .../proto/substrait/parameterized_types.proto | 23 +- inst/substrait/proto/substrait/plan.proto | 9 +- .../substrait/proto/substrait/relations.proto | 238 -- inst/substrait/proto/substrait/type.proto | 21 +- .../proto/substrait/type_expressions.proto | 22 +- man/SubstraitCompiler.Rd | 7 +- man/duckdb_get_substrait.Rd | 16 +- man/example_data.Rd | 75 +- man/select.SubstraitCompiler.Rd | 2 +- man/substrait_compiler.Rd | 2 +- man/substrait_create.Rd | 2 +- man/substrait_project.Rd | 13 +- src/{expression.pb.c => algebra.pb.c} | 149 +- src/any.pb.c | 5 +- src/capabilities.pb.c | 2 +- src/extensions.pb.c | 2 +- src/function.pb.c | 2 +- src/parameterized_types.pb.c | 5 +- src/pb.h | 52 +- src/pb_decode.c | 41 +- src/pb_encode.c | 23 +- src/pb_encode.h | 2 +- src/plan.pb.c | 2 +- src/relations.pb.c | 98 - src/substrait/algebra.pb.h | 2491 +++++++++++++++++ src/substrait/any.pb.h | 20 +- src/substrait/capabilities.pb.h | 16 +- src/substrait/expression.pb.h | 1200 -------- src/substrait/extensions/extensions.pb.h | 30 +- src/substrait/function.pb.h | 94 +- src/substrait/parameterized_types.pb.h | 96 +- src/substrait/plan.pb.h | 19 +- src/substrait/relations.pb.h | 773 ----- src/substrait/type.pb.h | 147 +- src/substrait/type_expressions.pb.h | 114 +- src/type.pb.c | 5 +- src/type_expressions.pb.c | 5 +- tests/testthat/test-aggregate-rel.R | 2 +- tests/testthat/test-compiler.R | 51 +- tests/testthat/test-expression.R | 16 +- tests/testthat/test-pkg-arrow.R | 6 +- tests/testthat/test-pkg-dplyr.R | 24 +- tests/testthat/test-pkg-duckdb.R | 15 +- tests/testthat/test-project-rel.R | 55 +- 88 files changed, 6039 insertions(+), 4136 deletions(-) create mode 100644 data-raw/example_data.R create mode 100644 inst/substrait/CHANGELOG.md create mode 100644 inst/substrait/CONTRIBUTING.md create mode 100644 inst/substrait/ci/commit_messages.sh create mode 100644 inst/substrait/ci/release/dry_run.sh create mode 100644 inst/substrait/ci/release/prepare.sh create mode 100644 inst/substrait/ci/release/publish.sh create mode 100644 inst/substrait/ci/release/run.sh create mode 100644 inst/substrait/ci/release/verify.sh create mode 100644 inst/substrait/extensions/functions_aggregate_approx.yaml create mode 100644 inst/substrait/extensions/functions_cast.yaml create mode 100644 inst/substrait/proto/substrait/algebra.proto delete mode 100644 inst/substrait/proto/substrait/expression.proto delete mode 100644 inst/substrait/proto/substrait/relations.proto rename src/{expression.pb.c => algebra.pb.c} (59%) delete mode 100644 src/relations.pb.c create mode 100644 src/substrait/algebra.pb.h delete mode 100644 src/substrait/expression.pb.h delete mode 100644 src/substrait/relations.pb.h diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6cd14c2b..08a650a1 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -40,12 +40,10 @@ jobs: steps: - uses: actions/checkout@v3 - with: - path: substrait - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} @@ -57,57 +55,40 @@ jobs: - name: Setup substrait dependencies uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: rcmdcheck, local::., arrow=?ignore - working-directory: /home/runner/work/substrait-r/substrait-r/substrait - - - name: Cache DuckDB with Substrait - uses: actions/cache@v3 - with: - path: "~/.local/share/R-substrait/duckdb_lib" - key: ${{ runner.os }}-1 - - - name: Setup custom duckdb - run: | - if (!substrait::has_duckdb_with_substrait()) { - substrait::install_duckdb_with_substrait() - } - shell: Rscript {0} - - - name: Checkout Arrow repo - uses: actions/checkout@v3 - with: - repository: apache/arrow - path: arrow - # Last commit before Arrow updated to Substrait v 0.6.0 - ref: '3d6240c1ee7802829d2ed209f4135906e9413915' - - - name: Install Arrow with ARROW_SUBSTRAIT turned on - run: | - mkdir install_dir - cd /home/runner/work/substrait-r/substrait-r/arrow/cpp - mkdir build_dir - cd build_dir - - cmake -DCMAKE_INSTALL_PREFIX=${ARROW_HOME} \ - -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Debug -DARROW_COMPUTE=ON -DARROW_CSV=ON -DARROW_DATASET=OFF \ - -DARROW_FILESYSTEM=ON -DARROW_JEMALLOC=OFF -DARROW_JSON=OFF -DARROW_PARQUET=ON -DARROW_WITH_SNAPPY=OFF \ - -DARROW_WITH_ZLIB=OFF -DARROW_INSTALL_NAME_RPATH=OFF -DARROW_EXTRA_ERROR_CONTEXT=ON \ - -DARROW_INSTALL_NAME_RPATH=OFF -DARROW_DEPENDENCY_SOURCE=BUNDLED -DARROW_SUBSTRAIT=ON .. - - sudo make -j2 install - - - name: Setup arrow dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - with: - working-directory: /home/runner/work/substrait-r/substrait-r/arrow/r/ - - - name: Install Arrow R package - run: | - cd /home/runner/work/substrait-r/substrait-r/arrow/r/ - make clean - R CMD INSTALL . + extra-packages: rcmdcheck + + # Not using arrow package until https://github.com/apache/arrow/pull/13914 merges + # - name: Checkout Arrow repo + # uses: actions/checkout@v3 + # with: + # repository: apache/arrow + # path: arrow + # + # - name: Install Arrow with ARROW_SUBSTRAIT turned on + # run: | + # mkdir install_dir + # cd /home/runner/work/substrait-r/substrait-r/arrow/cpp + # mkdir build_dir + # cd build_dir + # + # cmake -DCMAKE_INSTALL_PREFIX=${ARROW_HOME} \ + # -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Debug -DARROW_COMPUTE=ON -DARROW_CSV=ON -DARROW_DATASET=OFF \ + # -DARROW_FILESYSTEM=ON -DARROW_JEMALLOC=OFF -DARROW_JSON=OFF -DARROW_PARQUET=ON -DARROW_WITH_SNAPPY=OFF \ + # -DARROW_WITH_ZLIB=OFF -DARROW_INSTALL_NAME_RPATH=OFF -DARROW_EXTRA_ERROR_CONTEXT=ON \ + # -DARROW_INSTALL_NAME_RPATH=OFF -DARROW_DEPENDENCY_SOURCE=BUNDLED -DARROW_SUBSTRAIT=ON .. + # + # sudo make -j2 install + # + # - name: Setup arrow dependencies + # uses: r-lib/actions/setup-r-dependencies@v2 + # with: + # working-directory: /home/runner/work/substrait-r/substrait-r/arrow/r/ + # + # - name: Install Arrow R package + # run: | + # cd /home/runner/work/substrait-r/substrait-r/arrow/r/ + # make clean + # R CMD INSTALL . - name: Run R CMD check uses: r-lib/actions/check-r-package@v2 - with: - working-directory: /home/runner/work/substrait-r/substrait-r/substrait diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 36eedd8e..2176e142 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -22,30 +22,17 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - if: runner.os == 'Linux' run: sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: covr - - name: Cache DuckDB with Substrait - uses: actions/cache@v3 - with: - path: "~/.local/share/R-substrait/duckdb_lib" - key: ${{ runner.os }}-1 - - - name: Setup custom duckdb - run: | - if (!substrait::has_duckdb_with_substrait()) { - substrait::install_duckdb_with_substrait() - } - shell: Rscript {0} - - name: Test coverage run: covr::codecov() shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index af6b4839..24a791d5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,11 +16,11 @@ Description: Provides an R interface to the 'Substrait' cross-language License: Apache License (>= 2) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.0 +RoxygenNote: 7.2.1 Suggests: arrow, covr, - duckdb, + duckdb (>= 0.5.0), DBI, callr, rappdirs, diff --git a/NAMESPACE b/NAMESPACE index cefcd62b..90002dcc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -60,11 +60,9 @@ export(as_substrait) export(duckdb_from_substrait) export(duckdb_get_substrait) export(duckdb_substrait_compiler) -export(duckdb_with_substrait_lib_dir) export(filter) export(from_substrait) export(has_duckdb_with_substrait) -export(install_duckdb_with_substrait) export(select) export(substrait) export(substrait_aggregate) @@ -84,6 +82,7 @@ export(substrait_i8) export(substrait_interval_day) export(substrait_interval_year) export(substrait_project) +export(substrait_select) export(substrait_sort) export(substrait_sort_field) export(substrait_string) diff --git a/R/aggregate-rel.R b/R/aggregate-rel.R index fc8c2a4e..b0aed018 100644 --- a/R/aggregate-rel.R +++ b/R/aggregate-rel.R @@ -1,7 +1,7 @@ #' Aggregate #' -#' @inheritParams substrait_project +#' @inheritParams substrait_select #' @param ... #' - `substrait_aggregate()`: A named list of expressions to be evaluated in the context #' of the aggregation. @@ -38,7 +38,7 @@ substrait_aggregate <- function(.compiler, ...) { ) ) - # reset mask and schema here (probably should do this in substrait_project + # reset mask and schema here (probably should do this in substrait_select # too) types <- c( lapply( diff --git a/R/compiler.R b/R/compiler.R index 2990865c..1740a0c5 100644 --- a/R/compiler.R +++ b/R/compiler.R @@ -9,7 +9,7 @@ #' will need to subclass the [SubstraitCompiler] and implement the `$evaluate()` #' and/or `$resolve_function()` methods. Typically users will not interact #' with R6 methods but will use the pipeable interface -#' (e.g. [substrait_project()]). The pipeable interface clones the compiler +#' (e.g. [substrait_select()]). The pipeable interface clones the compiler #' before it is modified to minimize the user's interaction to R6 reference #' semantics. #' @@ -24,6 +24,8 @@ #' @param template A `substrait.Expression.ScalarFunction`, a #' `substrait.Expression.WindowFunction`, or a #' `substrait.AggregateFunction`. +#' @param output_type An explicit output type to use or a function accepting +#' one type per `args`. #' #' @export SubstraitCompiler <- R6::R6Class( @@ -195,7 +197,7 @@ SubstraitCompiler <- R6::R6Class( #' #' @return A modified `template` with `function_reference`, #' `args`, and `output_type` set. - resolve_function = function(name, args, template) { + resolve_function = function(name, args, template, output_type = NULL) { # resolve arguments as Expressions if they haven't been already # (generally they should be already but this will assert that) args <- lapply( @@ -211,12 +213,16 @@ SubstraitCompiler <- R6::R6Class( # resolve the function identifier id <- self$function_id(name, arg_types) - # maybe there's a way to know this later on but for now, - # leave an unspecified type - output_type <- substrait$Type$create() + if (is.null(output_type)) { + output_type <- substrait$Type$create() + } else if (is.function(output_type)) { + output_type <- do.call(output_type, arg_types) + } template$function_reference <- id - template$args <- args + template$arguments <- lapply(args, function(arg) { + substrait$FunctionArgument$create(value = arg) + }) template$output_type <- output_type template diff --git a/R/example_data.R b/R/example_data.R index a227932d..2bf3b3f0 100644 --- a/R/example_data.R +++ b/R/example_data.R @@ -2,47 +2,6 @@ #' #' Data for use in examples and tests with multiple different data types #' -#' Currently generated via: -#' example_data <- tibble::tibble( -#' int = c(-3212L, 2L, 3L, NA_integer_, 5L, 6L, 7L, 8L, 9L, -#' 3212L), -#' dbl = c(-999, -99, -9, 0, -#' 9, pi, 99, 10000, 10000, NA_real_), -#' dbl2 = c(-Inf, 5, 5, 5, 5, 5, 5, 5, 5, 5), -#' lgl = c(NA, TRUE, NA, TRUE, FALSE, FALSE, NA, TRUE, FALSE, TRUE), -#' false = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), -#' chr = c("a", "b", "c", "d", "e", NA, "g", "h", "i", "j"), -#' verses = c("Por cada muro, un lamento", "En Jerusalén la dorada", -#' "Y mil vidas malgastadas", "Por cada mandamiento", "Yo soy polvo de tu viento", -#' "Y aunque sangro de tu herida", "Y cada piedra querida", -#' "Guarda mi amor más profundo", "No hay una piedra en el mundo", -#' "Que valga lo que una vida"), -#' padded_strings = c(" a ", " b ", -#' " c ", " d ", " e ", " f ", " g ", -#' " h ", " i ", " j "), -#' some_negative = c(-1, 2, -3, NA, -5, 6, -7, 8, -9, 10)#, -#' # https://github.com/voltrondata/substrait-r/issues/80 -#' # dttm = lubridate::ymd_hms(c( -#' # "0000-01-01 00:00:00", -#' # "1919-05-29 13:08:55", -#' # "1955-06-20 04:10:42", -#' # "1973-06-30 11:38:41", -#' # "1987-03-29 12:49:47", -#' # "1991-06-11 19:07:01", -#' # NA_character_, -#' # "2017-08-21 18:26:40", -#' # "2017-08-21 18:26:40", -#' # "9999-12-31 23:59:59" -#' # )) -#' ) -#' -#' @docType data -#' -#' @usage data(example_data) -#' -#' @keywords datasets -#' -#' #' @examples -#' data(example_data) +#' example_data "example_data" diff --git a/R/filter-rel.R b/R/filter-rel.R index 13637e03..bdba8fec 100644 --- a/R/filter-rel.R +++ b/R/filter-rel.R @@ -2,7 +2,7 @@ #' Append a Substrait Project Relation #' #' @param ... Filter expressions -#' @inheritParams substrait_project +#' @inheritParams substrait_select #' #' @return A modified `.compiler` #' @export diff --git a/R/pkg-arrow.R b/R/pkg-arrow.R index 5d001fe2..8087dce1 100644 --- a/R/pkg-arrow.R +++ b/R/pkg-arrow.R @@ -245,8 +245,7 @@ substrait_eval_arrow <- function(plan, tables, col_names) { items = list( substrait$ReadRel$LocalFiles$FileOrFiles$create( uri_file = sprintf("file://%s", temp_parquet[i]), - format = substrait$ReadRel$LocalFiles$FileOrFiles$FileFormat$ - FILE_FORMAT_PARQUET + parquet = substrait$ReadRel$LocalFiles$FileOrFiles$ParquetReadOptions$create() ) ) ) diff --git a/R/pkg-dplyr.R b/R/pkg-dplyr.R index 764e1c81..1789c0c0 100644 --- a/R/pkg-dplyr.R +++ b/R/pkg-dplyr.R @@ -69,7 +69,7 @@ select.SubstraitCompiler <- function(.data, ...) { names(column_indices) ) - substrait_project(.data, !!!new_mask) + substrait_select(.data, !!!new_mask) } #' @rdname select.SubstraitCompiler @@ -91,13 +91,13 @@ rename.SubstraitCompiler <- function(.data, ...) { new_column_names ) - substrait_project(.data, !!!new_mask) + substrait_select(.data, !!!new_mask) } #' @rdname select.SubstraitCompiler #' @importFrom dplyr rename_with #' @export -rename_with.SubstraitCompiler <- function(.data, .fn, .cols = everything(), ...) { +rename_with.SubstraitCompiler <- function(.data, .fn, .cols = dplyr::everything(), ...) { .fn <- rlang::as_function(.fn) old_names <- dplyr::select(.data, {{ .cols }})$schema$names dplyr::rename(.data, !!rlang::set_names(old_names, .fn(old_names))) @@ -118,14 +118,14 @@ mutate.SubstraitCompiler <- function(.data, ..., .keep <- match.arg(.keep) mask <- .data$mask - out <- substrait_project(.data, !!!mask, ...) + out <- substrait_select(.data, !!!mask, ...) if (.keep == "all") { return(out) } # if only keeping a subset of columns, work out which and project again cols <- names(mutate(simulate_data_frame(.data), ..., .keep = .keep)) - substrait_project(out, !!!out$mask[cols], !!!rlang::syms(cols)) + substrait_select(out, !!!out$mask[cols], !!!rlang::syms(cols)) } #' @rdname select.SubstraitCompiler @@ -133,7 +133,7 @@ mutate.SubstraitCompiler <- function(.data, ..., #' @export transmute.SubstraitCompiler <- function(.data, ...) { check_transmute_args(...) - substrait_project(.data, ...) + substrait_select(.data, ...) } #' @rdname select.SubstraitCompiler @@ -284,7 +284,7 @@ relocate.SubstraitCompiler <- function(.data, ..., .before = NULL, .after = NULL new_column_names[pos] ) - substrait_project(.data, !!!new_mask) + substrait_select(.data, !!!new_mask) } # translate desc() call to the equivalent @@ -327,12 +327,12 @@ simulate_data_frame <- function(compiler) { check_transmute_args <- function(..., .keep, .before, .after, error_call = rlang::caller_env()) { if (!missing(.keep)) { - abort("The `.keep` argument is not supported.", call = error_call) + rlang::abort("The `.keep` argument is not supported.", call = error_call) } if (!missing(.before)) { - abort("The `.before` argument is not supported.", call = error_call) + rlang::abort("The `.before` argument is not supported.", call = error_call) } if (!missing(.after)) { - abort("The `.after` argument is not supported.", call = error_call) + rlang::abort("The `.after` argument is not supported.", call = error_call) } } diff --git a/R/pkg-duckdb.R b/R/pkg-duckdb.R index 2c12ce36..73a0e0a0 100644 --- a/R/pkg-duckdb.R +++ b/R/pkg-duckdb.R @@ -7,8 +7,6 @@ #' data.frame. #' @param tables A named list of tables to populate the database #' @param col_names The final column names for the result -#' @param lib A directry where the custom duckdb will be installed -#' @param force,quiet Passed to the remotes installer #' #' @return #' - `duckdb_get_substrait()`: a substrait.Plan protobuf object @@ -26,20 +24,13 @@ duckdb_get_substrait <- function(sql, tables = list()) { stopifnot(has_duckdb_with_substrait()) - temp_con <- DBI::dbConnect(duckdb::duckdb()) - on.exit(DBI::dbDisconnect(temp_con, shutdown = TRUE)) - sql_quoted <- DBI::dbQuoteLiteral(temp_con, sql) + result <- with_duckdb_tables(tables, function(con) { + duckdb::duckdb_get_substrait(con, sql) + }) - result <- query_duckdb_with_substrait( - sprintf("CALL get_substrait(%s)", sql_quoted), - tables = tables, - as_data_frame = TRUE - ) - plan <- unclass(result[[1]])[[1]] - ptype <- make_ptype("substrait.Plan") structure( - list(content = plan), - class = class(ptype) + list(content = result), + class = class(make_ptype("substrait.Plan")) ) } @@ -52,12 +43,15 @@ duckdb_from_substrait <- function(plan, tables = list(), stopifnot(has_duckdb_with_substrait()) plan <- as_substrait(plan, "substrait.Plan") - - result <- query_duckdb_with_substrait( - sprintf("CALL from_substrait(%s)", duckdb_encode_blob(plan)), - as_data_frame = as_data_frame, - tables = tables - ) + result <- with_duckdb_tables(tables, function(con) { + res <- duckdb::duckdb_prepare_substrait(con, unclass(plan)$content, arrow = TRUE) + reader <- duckdb::duckdb_fetch_record_batch(res) + if (as_data_frame) { + tibble::as_tibble(as.data.frame(reader$read_table())) + } else { + reader$read_table() + } + }) names(result) <- col_names result @@ -65,7 +59,7 @@ duckdb_from_substrait <- function(plan, tables = list(), #' @rdname duckdb_get_substrait #' @export -has_duckdb_with_substrait <- function(lib = duckdb_with_substrait_lib_dir()) { +has_duckdb_with_substrait <- function() { if (!identical(duckdb_works_cache$works, NA)) { return(duckdb_works_cache$works) } @@ -76,156 +70,51 @@ has_duckdb_with_substrait <- function(lib = duckdb_with_substrait_lib_dir()) { } duckdb_works_cache$works <- tryCatch( - { - query_duckdb_with_substrait( - query_duckdb_with_substrait("CALL from_substrait()"), - lib = lib - ) - TRUE - }, - error = function(e) { - from_substrait_exists <- grepl( - "from_substrait\\(BLOB\\)", - conditionMessage(e) - ) - - error_is_from_us <- grepl( - "there is no package called 'duckdb'", - conditionMessage(e) - ) - - if (from_substrait_exists) { - TRUE - } else if (error_is_from_us) { - FALSE - } else { - rlang::abort( - "An unexpected error occured whilst querying Substrait-enabled duckdb", - parent = e - ) - } - } + with_duckdb_tables(list(), function(con) TRUE), + error = function(e) FALSE ) duckdb_works_cache$works } -query_duckdb_with_substrait <- function(sql, dbdir = ":memory:", - lib = duckdb_with_substrait_lib_dir(), - tables = list(), - as_data_frame = TRUE) { - sink <- tempfile() +# The check takes enough time that we cache the result after the first check. +duckdb_works_cache <- new.env(parent = emptyenv()) +duckdb_works_cache$works <- NA - # write all tables to temporary parquet files so we can load them in to - # duckdb from another process +with_duckdb_tables <- function(tables, fun) { + # Write all tables to temporary parquet files so we can load them in to + # duckdb (TODO: don't use files and/or use VIEW. A VIEW currently + # does not work with duckdb's substrait preparation). stopifnot(rlang::is_named2(tables)) + con <- DBI::dbConnect(duckdb::duckdb()) temp_parquet <- vapply(tables, function(i) tempfile(), character(1)) - on.exit(unlink(c(sink, temp_parquet))) - for (i in seq_along(tables)) { - arrow::write_parquet(tables[[i]], temp_parquet[i]) - } - - fun <- function(sql, sink, dbdir, lib, temp_parquet) { - # don't load duckdb from anything except `lib` and error otherwise - # because the subprocess may have duckdb in a default, site, or user lib - if (!requireNamespace("duckdb", lib.loc = lib, quietly = TRUE)) { - stop( - sprintf("there is no package called 'duckdb'"), - call. = FALSE - ) - } - - con <- DBI::dbConnect(duckdb::duckdb(dbdir = dbdir)) - on.exit(DBI::dbDisconnect(con, shutdown = TRUE)) - - # register all the temporary parquet files as named tables - for (i in seq_along(temp_parquet)) { - DBI::dbExecute( - con, - sprintf( - "CREATE TABLE %s AS SELECT * FROM parquet_scan(%s);", - DBI::dbQuoteIdentifier(con, names(temp_parquet)[i]), - DBI::dbQuoteLiteral(con, temp_parquet[i]) - ) - ) - } + on.exit({ + unlink(temp_parquet) + DBI::dbDisconnect(con, shutdown = TRUE) + }) - res <- DBI::dbSendQuery(con, sql, arrow = TRUE) + DBI::dbExecute(con, "INSTALL substrait; LOAD substrait;") - # this could be streamed in the future when the parquet writer - # in R supports streaming - reader <- duckdb::duckdb_fetch_record_batch(res) - table <- reader$read_table() - arrow::write_parquet(table, sink) - sink + for (i in seq_along(tables)) { + arrow::write_parquet(tables[[i]], temp_parquet[i]) } - callr::r( - fun, - list(sql, sink, dbdir, lib, temp_parquet), - libpath = c(lib, .libPaths()) - ) - - arrow::read_parquet(sink, as_data_frame = as_data_frame) -} - -#' @rdname duckdb_get_substrait -#' @export -install_duckdb_with_substrait <- function(lib = duckdb_with_substrait_lib_dir(), - force = TRUE, quiet = FALSE) { - if (!quiet) { - message( - paste0( - "Installing duckdb with the ability to run substrait ", - "to custom library \n'", lib, "'" + # register all the temporary parquet files as named tables + for (i in seq_along(temp_parquet)) { + DBI::dbExecute( + con, + sprintf( + "CREATE TABLE %s AS SELECT * FROM parquet_scan(%s);", + DBI::dbQuoteIdentifier(con, names(temp_parquet)[i]), + DBI::dbQuoteLiteral(con, temp_parquet[i]) ) ) } - # `build = FALSE` so that the duckdb cpp source is available when the R package - # is compiling itself - fun <- function(lib) { - if (!dir.exists(lib)) { - dir.create(lib, recursive = TRUE) - } - - remotes::install_cran("DBI", lib = lib, force = force) - remotes::install_github( - "duckdb/duckdb/tools/rpkg", - build = FALSE, - force = force, - lib = lib - ) - } - - withr::with_envvar( - list(DUCKDB_R_EXTENSIONS = "substrait"), - callr::r(fun, list(lib), libpath = c(lib, .libPaths()), show = !quiet) - ) - - duckdb_works_cache$works <- NA -} - -#' @rdname duckdb_get_substrait -#' @export -duckdb_with_substrait_lib_dir <- function() { - Sys.getenv( - "R_SUBSTRAIT_DUCKDB_LIB", - file.path(rappdirs::user_data_dir("R-substrait"), "duckdb_lib") - ) + fun(con) } -duckdb_encode_blob <- function(x) { - data <- paste0("\\x", as.raw(x), collapse = "") - paste0("'", data, "'::BLOB") -} - -duckdb_works_cache <- new.env(parent = emptyenv()) -duckdb_works_cache$works <- NA - - - #' Create an DuckDB Substrait Compiler #' #' @inheritParams arrow_substrait_compiler @@ -255,22 +144,23 @@ DuckDBSubstraitCompiler <- R6::R6Class( # whereas self$resolve_function() will apply translations as we # implement them here. switch(name, - "==" = super$resolve_function("equal", args, template), - "!=" = super$resolve_function("not_equal", args, template), - ">=" = super$resolve_function("gte", args, template), - "<=" = super$resolve_function("lte", args, template), - ">" = super$resolve_function("gt", args, template), - "<" = super$resolve_function("lt", args, template), + "==" = super$resolve_function("equal", args, template, output_type = substrait_boolean()), + "!=" = super$resolve_function("not_equal", args, template, output_type = substrait_boolean()), + ">=" = super$resolve_function("gte", args, template, output_type = substrait_boolean()), + "<=" = super$resolve_function("lte", args, template, output_type = substrait_boolean()), + ">" = super$resolve_function("gt", args, template, output_type = substrait_boolean()), + "<" = super$resolve_function("lt", args, template, output_type = substrait_boolean()), "between" = super$resolve_function( "and", list( - super$resolve_function("gte", args[-3], template), - super$resolve_function("lte", args[-2], template) + super$resolve_function("gte", args[-3], template, output_type = substrait_boolean()), + super$resolve_function("lte", args[-2], template, output_type = substrait_boolean()) ), - template + template, + output_type = substrait_boolean() ), - "&" = super$resolve_function("and", args, template), - "|" = super$resolve_function("or", args, template), + "&" = super$resolve_function("and", args, template, output_type = substrait_boolean()), + "|" = super$resolve_function("or", args, template, output_type = substrait_boolean()), # while I'm sure that "not" exists somehow, this is the only way # I can get it to work for now (NULLs are not handled properly here) "!" = { @@ -302,7 +192,7 @@ DuckDBSubstraitCompiler <- R6::R6Class( "!", list( as_substrait( - super$resolve_function("is_not_null", args, template), + super$resolve_function("is_not_null", args, template, output_type = substrait_boolean()), "substrait.Expression" ) ), @@ -348,21 +238,22 @@ DuckDBSubstraitCompiler <- R6::R6Class( super$resolve_function( "equal", list(lhs, rhs$literal$list$values[[1]]), - template + template, + output_type = substrait_boolean() ) ) } equal_expressions <- lapply(rhs$literal$list$values, function(value) { as_substrait( - super$resolve_function("equal", list(lhs, value), template), + super$resolve_function("equal", list(lhs, value), template, output_type = substrait_boolean()), "substrait.Expression" ) }) combine_or <- function(lhs, rhs) { as_substrait( - super$resolve_function("or", list(lhs, rhs), template), + super$resolve_function("or", list(lhs, rhs), template, output_type = substrait_boolean()), "substrait.Expression" ) } @@ -377,7 +268,7 @@ DuckDBSubstraitCompiler <- R6::R6Class( "*" = , "/" = , "^" = , - "sum" = super$resolve_function(name, args, template), + "sum" = super$resolve_function(name, args, template, output_type = function(x, y) x), rlang::abort( paste0('could not find function "', name, '"') ) diff --git a/R/project-rel.R b/R/project-rel.R index 30e35bce..fe1aabeb 100644 --- a/R/project-rel.R +++ b/R/project-rel.R @@ -3,30 +3,32 @@ #' #' @param .compiler A [substrait_compiler()] or object that can be coerced to one #' @param ... Expressions +#' @param .drop_columns A character vector of columns to explicitly drop before +#' adding expressions specified in `...`. #' #' @return A modified `.compiler` #' @export #' #' @examples -#' substrait_project( -#' data.frame(a = 1, b = "one"), -#' c = a + 1 -#' ) +#' substrait_select(data.frame(a = 1, b = "one"), c = a + 1) #' -substrait_project <- function(.compiler, ...) { +substrait_project <- function(.compiler, ..., .drop_columns = character()) { .compiler <- substrait_compiler(.compiler)$clone() - # evaluate expressions sequentially, updating the compiler as we go so that + # Evaluate expressions sequentially, updating the compiler as we go so that # fields created by earlier arguments are accessible from later arguments quos <- rlang::enquos(..., .named = TRUE) expressions <- list() types <- list() + # Keep a list of columns that were specified as explicit NULLs + quos_that_were_null <- character() + for (i in seq_along(quos)) { name <- names(quos)[i] - if (!rlang::quo_is_null(quos[[i]])) { - # do the evaluation and calculate the output type + if (!rlang::quo_is_null(quos[[i]])) { + # Do the evaluation and calculate the output type value <- as_substrait( quos[[i]], .ptype = "substrait.Expression", @@ -34,32 +36,60 @@ substrait_project <- function(.compiler, ...) { ) type <- as_substrait(value, .ptype = "substrait.Type", compiler = .compiler) - # update the compiler + # Update the compiler mask (used for symbol lookup for subsequent expressions) .compiler$mask[[name]] <- value - .compiler$schema$names <- union(.compiler$schema$names, name) - .compiler$schema$struct_$types[[match(name, .compiler$schema$names)]] <- - type # keep track of the new expressions and types expressions[[name]] <- value types[[name]] <- type + + # ...and make sure we forget a previous explicit NULL for this name + quos_that_were_null <- setdiff(quos_that_were_null, name) } else { + # Remove from the compiler mask so that we can't use the NULL column in a + # subsequent argument (as per dplyr behaviour) + .compiler$mask[[name]] <- NULL + + # Remove from our list of new expressions to append if it had been + # previously added expressions[[name]] <- NULL types[[name]] <- NULL - # remove from compiler so that we can't use the NULL column later - # (as per dplyr behaviour) - .compiler$mask[[name]] <- NULL - index_match <- match(name, .compiler$schema$names) - if (!is.na(index_match)) { - .compiler$schema$struct_$types[[index_match]] <- NULL - } - .compiler$schema$names <- .compiler$schema$names[.compiler$schema$names != name] + + # ...and make sure we drop this column if it already existed + quos_that_were_null <- union(quos_that_were_null, name) } } - # create the relation with the new expressions and types + # Apply NULL quosure arguments to .drop_columns + .drop_columns <- union(quos_that_were_null, .drop_columns) + + # Create the Emit.output_mapping we need to get our final columns + names_using_only_append_logic <- c(.compiler$schema$names, names(expressions)) + # The rev()s here are to make sure the column order comes out as expected + # since unique() keeps the first instance of a value it encounters. + final_columns <- unique(rev(setdiff(rev(names_using_only_append_logic), .drop_columns))) + + # Match from last item (we want the value that we just calculated to replace + # the value that previously existed) + output_mapping <- length(names_using_only_append_logic) + + 1L - match(final_columns, rev(names_using_only_append_logic)) + + # Don't include the Emit object if it isn't needed (in case the engine + # hasn't implemented it) + if (identical(output_mapping, seq_along(names_using_only_append_logic))) { + common <- substrait$RelCommon$create() + } else { + common <- substrait$RelCommon$create( + emit = substrait$RelCommon$Emit$create( + output_mapping = output_mapping + ) + ) + } + + # Create the relation with the new expressions and types rel <- substrait$Rel$create( project = substrait$ProjectRel$create( + common = common, input = .compiler$rel, expressions = expressions ) @@ -67,34 +97,29 @@ substrait_project <- function(.compiler, ...) { # update the compiler .compiler$rel <- rel - .compiler$schema$names <- names(expressions) - .compiler$schema$struct_$types <- types + .compiler$schema$names <- final_columns + .compiler$schema$struct_$types <- c(.compiler$schema$struct_$types, types)[output_mapping] # reset the mask .compiler$mask <- lapply( - seq_along(types) - 1L, + seq_along(.compiler$schema$struct_$types) - 1L, simple_integer_field_reference ) - names(.compiler$mask) <- names(types) + names(.compiler$mask) <- .compiler$schema$names .compiler$validate() } -# Take selected columns and create the appropriate substrait message -build_projections <- function(df, projections) { - # get numeric matches of column positions - locs <- match( - unname(vapply(projections, as.character, character(1))), - names(df) - ) +#' @rdname substrait_project +#' @export +substrait_select <- function(.compiler, ...) { + .compiler <- substrait_compiler(.compiler) + quos <- rlang::enquos(..., .named = TRUE) - # -1 as it's 0-indexed but tidyselect is 1-indexed - expressions <- lapply( - locs - 1, - simple_integer_field_reference - ) + final_col_names <- names(quos) + drop_cols <- setdiff(.compiler$schema$names, final_col_names) - expressions + substrait_project(.compiler, !!! quos, .drop_columns = drop_cols) } # Simplify the verbose definition of a field reference diff --git a/R/sort-rel.R b/R/sort-rel.R index c597a77b..f4c122e7 100644 --- a/R/sort-rel.R +++ b/R/sort-rel.R @@ -1,7 +1,7 @@ #' Append a Substrait Project Relation #' -#' @inheritParams substrait_project +#' @inheritParams substrait_select #' @param ... Expressions that evaluate to an Expression or SortField #' @param expr An expression that evaluates to an Expression #' @param direction A SortField.SortDirection diff --git a/R/types-generated.R b/R/types-generated.R index 11aae1ea..82ded8d3 100644 --- a/R/types-generated.R +++ b/R/types-generated.R @@ -15,59 +15,167 @@ substrait <- list( ) } ), - Any = list( - create = function(..., type_url = unspecified(), value = unspecified()) { + AggregateFunction = list( + AggregationInvocation = list( + AGGREGATION_INVOCATION_UNSPECIFIED = structure(0L, class = c("substrait_AggregateFunction_AggregationInvocation", "substrait_proto_enum", "substrait_proto")), + AGGREGATION_INVOCATION_ALL = structure(1L, class = c("substrait_AggregateFunction_AggregationInvocation", "substrait_proto_enum", "substrait_proto")), + AGGREGATION_INVOCATION_DISTINCT = structure(2L, class = c("substrait_AggregateFunction_AggregationInvocation", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.AggregateFunction.AggregationInvocation" + ) + } + ), + create = function(..., function_reference = unspecified(), arguments = unspecified(), sorts = unspecified(), phase = unspecified(), output_type = unspecified(), invocation = unspecified(), args = unspecified()) { rlang::check_dots_empty() create_substrait_message( - type_url = clean_value(type_url, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - value = clean_value(value, "TYPE_BYTES", "TYPE_BYTES", repeated = FALSE), - .qualified_name = "substrait.Any" + function_reference = clean_value(function_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionArgument", repeated = TRUE), + sorts = clean_value(sorts, "TYPE_MESSAGE", "substrait.SortField", repeated = TRUE), + phase = clean_value(phase, "TYPE_ENUM", "substrait.AggregationPhase", repeated = FALSE), + output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), + invocation = clean_value(invocation, "TYPE_ENUM", "substrait.AggregateFunction.AggregationInvocation", repeated = FALSE), + args = clean_value(args, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), + .qualified_name = "substrait.AggregateFunction" ) } ), - Capabilities = list( - SimpleExtension = list( - create = function(..., uri = unspecified(), function_keys = unspecified(), type_keys = unspecified(), type_variation_keys = unspecified()) { + AggregateRel = list( + Grouping = list( + create = function(..., grouping_expressions = unspecified()) { rlang::check_dots_empty() create_substrait_message( - uri = clean_value(uri, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - function_keys = clean_value(function_keys, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - type_keys = clean_value(type_keys, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - type_variation_keys = clean_value(type_variation_keys, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - .qualified_name = "substrait.Capabilities.SimpleExtension" + grouping_expressions = clean_value(grouping_expressions, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), + .qualified_name = "substrait.AggregateRel.Grouping" ) } ), - create = function(..., substrait_versions = unspecified(), advanced_extension_type_urls = unspecified(), simple_extensions = unspecified()) { + Measure = list( + create = function(..., measure = unspecified(), filter = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + measure = clean_value(measure, "TYPE_MESSAGE", "substrait.AggregateFunction", repeated = FALSE), + filter = clean_value(filter, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + .qualified_name = "substrait.AggregateRel.Measure" + ) + } + ), + create = function(..., common = unspecified(), input = unspecified(), groupings = unspecified(), measures = unspecified(), advanced_extension = unspecified()) { rlang::check_dots_empty() create_substrait_message( - substrait_versions = clean_value(substrait_versions, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - advanced_extension_type_urls = clean_value(advanced_extension_type_urls, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - simple_extensions = clean_value(simple_extensions, "TYPE_MESSAGE", "substrait.Capabilities.SimpleExtension", repeated = TRUE), - .qualified_name = "substrait.Capabilities" + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + groupings = clean_value(groupings, "TYPE_MESSAGE", "substrait.AggregateRel.Grouping", repeated = TRUE), + measures = clean_value(measures, "TYPE_MESSAGE", "substrait.AggregateRel.Measure", repeated = TRUE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.AggregateRel" ) } ), - AggregateFunction = list( - create = function(..., function_reference = unspecified(), args = unspecified(), sorts = unspecified(), phase = unspecified(), output_type = unspecified()) { + CrossRel = list( + create = function(..., common = unspecified(), left = unspecified(), right = unspecified(), advanced_extension = unspecified()) { rlang::check_dots_empty() create_substrait_message( - function_reference = clean_value(function_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - args = clean_value(args, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), - sorts = clean_value(sorts, "TYPE_MESSAGE", "substrait.SortField", repeated = TRUE), - phase = clean_value(phase, "TYPE_ENUM", "substrait.AggregationPhase", repeated = FALSE), - output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), - .qualified_name = "substrait.AggregateFunction" + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + left = clean_value(left, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + right = clean_value(right, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.CrossRel" + ) + } + ), + ExchangeRel = list( + Broadcast = list( + create = function(...) { + rlang::check_dots_empty() + create_substrait_message(.qualified_name = "substrait.ExchangeRel.Broadcast") + } + ), + ExchangeTarget = list( + create = function(..., partition_id = unspecified(), uri = unspecified(), extended = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + partition_id = clean_value(partition_id, "TYPE_INT32", "TYPE_INT32", repeated = TRUE), + uri = clean_value(uri, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + extended = clean_value(extended, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.ExchangeRel.ExchangeTarget" + ) + } + ), + MultiBucketExpression = list( + create = function(..., expression = unspecified(), constrained_to_count = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + expression = clean_value(expression, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + constrained_to_count = clean_value(constrained_to_count, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + .qualified_name = "substrait.ExchangeRel.MultiBucketExpression" + ) + } + ), + RoundRobin = list( + create = function(..., exact = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + exact = clean_value(exact, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + .qualified_name = "substrait.ExchangeRel.RoundRobin" + ) + } + ), + ScatterFields = list( + create = function(..., fields = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + fields = clean_value(fields, "TYPE_MESSAGE", "substrait.Expression.FieldReference", repeated = TRUE), + .qualified_name = "substrait.ExchangeRel.ScatterFields" + ) + } + ), + SingleBucketExpression = list( + create = function(..., expression = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + expression = clean_value(expression, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + .qualified_name = "substrait.ExchangeRel.SingleBucketExpression" + ) + } + ), + create = function(..., common = unspecified(), input = unspecified(), partition_count = unspecified(), targets = unspecified(), scatter_by_fields = unspecified(), single_target = unspecified(), multi_target = unspecified(), round_robin = unspecified(), broadcast = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + partition_count = clean_value(partition_count, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), + targets = clean_value(targets, "TYPE_MESSAGE", "substrait.ExchangeRel.ExchangeTarget", repeated = TRUE), + scatter_by_fields = clean_value(scatter_by_fields, "TYPE_MESSAGE", "substrait.ExchangeRel.ScatterFields", repeated = FALSE), + single_target = clean_value(single_target, "TYPE_MESSAGE", "substrait.ExchangeRel.SingleBucketExpression", repeated = FALSE), + multi_target = clean_value(multi_target, "TYPE_MESSAGE", "substrait.ExchangeRel.MultiBucketExpression", repeated = FALSE), + round_robin = clean_value(round_robin, "TYPE_MESSAGE", "substrait.ExchangeRel.RoundRobin", repeated = FALSE), + broadcast = clean_value(broadcast, "TYPE_MESSAGE", "substrait.ExchangeRel.Broadcast", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.ExchangeRel" ) } ), Expression = list( Cast = list( - create = function(..., type = unspecified(), input = unspecified()) { + FailureBehavior = list( + FAILURE_BEHAVIOR_UNSPECIFIED = structure(0L, class = c("substrait_Expression_Cast_FailureBehavior", "substrait_proto_enum", "substrait_proto")), + FAILURE_BEHAVIOR_RETURN_NULL = structure(1L, class = c("substrait_Expression_Cast_FailureBehavior", "substrait_proto_enum", "substrait_proto")), + FAILURE_BEHAVIOR_THROW_EXCEPTION = structure(2L, class = c("substrait_Expression_Cast_FailureBehavior", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.Expression.Cast.FailureBehavior" + ) + } + ), + create = function(..., type = unspecified(), input = unspecified(), failure_behavior = unspecified()) { rlang::check_dots_empty() create_substrait_message( type = clean_value(type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), input = clean_value(input, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + failure_behavior = clean_value(failure_behavior, "TYPE_ENUM", "substrait.Expression.Cast.FailureBehavior", repeated = FALSE), .qualified_name = "substrait.Expression.Cast" ) } @@ -121,19 +229,29 @@ substrait <- list( } ), FieldReference = list( + OuterReference = list( + create = function(..., steps_out = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + steps_out = clean_value(steps_out, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + .qualified_name = "substrait.Expression.FieldReference.OuterReference" + ) + } + ), RootReference = list( create = function(...) { rlang::check_dots_empty() create_substrait_message(.qualified_name = "substrait.Expression.FieldReference.RootReference") } ), - create = function(..., direct_reference = unspecified(), masked_reference = unspecified(), expression = unspecified(), root_reference = unspecified()) { + create = function(..., direct_reference = unspecified(), masked_reference = unspecified(), expression = unspecified(), root_reference = unspecified(), outer_reference = unspecified()) { rlang::check_dots_empty() create_substrait_message( direct_reference = clean_value(direct_reference, "TYPE_MESSAGE", "substrait.Expression.ReferenceSegment", repeated = FALSE), masked_reference = clean_value(masked_reference, "TYPE_MESSAGE", "substrait.Expression.MaskExpression", repeated = FALSE), expression = clean_value(expression, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), root_reference = clean_value(root_reference, "TYPE_MESSAGE", "substrait.Expression.FieldReference.RootReference", repeated = FALSE), + outer_reference = clean_value(outer_reference, "TYPE_MESSAGE", "substrait.Expression.FieldReference.OuterReference", repeated = FALSE), .qualified_name = "substrait.Expression.FieldReference" ) } @@ -171,11 +289,12 @@ substrait <- list( } ), IntervalDayToSecond = list( - create = function(..., days = unspecified(), seconds = unspecified()) { + create = function(..., days = unspecified(), seconds = unspecified(), microseconds = unspecified()) { rlang::check_dots_empty() create_substrait_message( days = clean_value(days, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), seconds = clean_value(seconds, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), + microseconds = clean_value(microseconds, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), .qualified_name = "substrait.Expression.Literal.IntervalDayToSecond" ) } @@ -227,6 +346,16 @@ substrait <- list( ) } ), + UserDefined = list( + create = function(..., type_reference = unspecified(), value = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + type_reference = clean_value(type_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + value = clean_value(value, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.Expression.Literal.UserDefined" + ) + } + ), VarChar = list( create = function(..., value = unspecified(), length = unspecified()) { rlang::check_dots_empty() @@ -237,7 +366,7 @@ substrait <- list( ) } ), - create = function(..., boolean = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year_to_month = unspecified(), interval_day_to_second = unspecified(), fixed_char = unspecified(), var_char = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), map = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), null = unspecified(), list = unspecified(), empty_list = unspecified(), empty_map = unspecified(), nullable = unspecified()) { + create = function(..., boolean = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year_to_month = unspecified(), interval_day_to_second = unspecified(), fixed_char = unspecified(), var_char = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), map = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), null = unspecified(), list = unspecified(), empty_list = unspecified(), empty_map = unspecified(), user_defined = unspecified(), nullable = unspecified(), type_variation_reference = unspecified()) { rlang::check_dots_empty() create_substrait_message( boolean = clean_value(boolean, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), @@ -266,7 +395,9 @@ substrait <- list( list = clean_value(list, "TYPE_MESSAGE", "substrait.Expression.Literal.List", repeated = FALSE), empty_list = clean_value(empty_list, "TYPE_MESSAGE", "substrait.Type.List", repeated = FALSE), empty_map = clean_value(empty_map, "TYPE_MESSAGE", "substrait.Type.Map", repeated = FALSE), + user_defined = clean_value(user_defined, "TYPE_MESSAGE", "substrait.Expression.Literal.UserDefined", repeated = FALSE), nullable = clean_value(nullable, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + type_variation_reference = clean_value(type_variation_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), .qualified_name = "substrait.Expression.Literal" ) } @@ -370,11 +501,11 @@ substrait <- list( ) } ), - create = function(..., select = unspecified(), maintain_singular_struct = unspecified()) { + create = function(..., select = unspecified(), maintain_singular_struct_ = unspecified()) { rlang::check_dots_empty() create_substrait_message( select = clean_value(select, "TYPE_MESSAGE", "substrait.Expression.MaskExpression.StructSelect", repeated = FALSE), - maintain_singular_struct = clean_value(maintain_singular_struct, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + maintain_singular_struct_ = clean_value(maintain_singular_struct_, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), .qualified_name = "substrait.Expression.MaskExpression" ) } @@ -440,12 +571,13 @@ substrait <- list( } ), ScalarFunction = list( - create = function(..., function_reference = unspecified(), args = unspecified(), output_type = unspecified()) { + create = function(..., function_reference = unspecified(), arguments = unspecified(), output_type = unspecified(), args = unspecified()) { rlang::check_dots_empty() create_substrait_message( function_reference = clean_value(function_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - args = clean_value(args, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), + arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionArgument", repeated = TRUE), output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), + args = clean_value(args, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), .qualified_name = "substrait.Expression.ScalarFunction" ) } @@ -460,6 +592,96 @@ substrait <- list( ) } ), + Subquery = list( + InPredicate = list( + create = function(..., needles = unspecified(), haystack = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + needles = clean_value(needles, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), + haystack = clean_value(haystack, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + .qualified_name = "substrait.Expression.Subquery.InPredicate" + ) + } + ), + Scalar = list( + create = function(..., input = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + .qualified_name = "substrait.Expression.Subquery.Scalar" + ) + } + ), + SetComparison = list( + ComparisonOp = list( + COMPARISON_OP_UNSPECIFIED = structure(0L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + COMPARISON_OP_EQ = structure(1L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + COMPARISON_OP_NE = structure(2L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + COMPARISON_OP_LT = structure(3L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + COMPARISON_OP_GT = structure(4L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + COMPARISON_OP_LE = structure(5L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + COMPARISON_OP_GE = structure(6L, class = c("substrait_Expression_Subquery_SetComparison_ComparisonOp", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.Expression.Subquery.SetComparison.ComparisonOp" + ) + } + ), + ReductionOp = list( + REDUCTION_OP_UNSPECIFIED = structure(0L, class = c("substrait_Expression_Subquery_SetComparison_ReductionOp", "substrait_proto_enum", "substrait_proto")), + REDUCTION_OP_ANY = structure(1L, class = c("substrait_Expression_Subquery_SetComparison_ReductionOp", "substrait_proto_enum", "substrait_proto")), + REDUCTION_OP_ALL = structure(2L, class = c("substrait_Expression_Subquery_SetComparison_ReductionOp", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.Expression.Subquery.SetComparison.ReductionOp" + ) + } + ), + create = function(..., reduction_op = unspecified(), comparison_op = unspecified(), left = unspecified(), right = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + reduction_op = clean_value(reduction_op, "TYPE_ENUM", "substrait.Expression.Subquery.SetComparison.ReductionOp", repeated = FALSE), + comparison_op = clean_value(comparison_op, "TYPE_ENUM", "substrait.Expression.Subquery.SetComparison.ComparisonOp", repeated = FALSE), + left = clean_value(left, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + right = clean_value(right, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + .qualified_name = "substrait.Expression.Subquery.SetComparison" + ) + } + ), + SetPredicate = list( + PredicateOp = list( + PREDICATE_OP_UNSPECIFIED = structure(0L, class = c("substrait_Expression_Subquery_SetPredicate_PredicateOp", "substrait_proto_enum", "substrait_proto")), + PREDICATE_OP_EXISTS = structure(1L, class = c("substrait_Expression_Subquery_SetPredicate_PredicateOp", "substrait_proto_enum", "substrait_proto")), + PREDICATE_OP_UNIQUE = structure(2L, class = c("substrait_Expression_Subquery_SetPredicate_PredicateOp", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.Expression.Subquery.SetPredicate.PredicateOp" + ) + } + ), + create = function(..., predicate_op = unspecified(), tuples = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + predicate_op = clean_value(predicate_op, "TYPE_ENUM", "substrait.Expression.Subquery.SetPredicate.PredicateOp", repeated = FALSE), + tuples = clean_value(tuples, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + .qualified_name = "substrait.Expression.Subquery.SetPredicate" + ) + } + ), + create = function(..., scalar = unspecified(), in_predicate = unspecified(), set_predicate = unspecified(), set_comparison = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + scalar = clean_value(scalar, "TYPE_MESSAGE", "substrait.Expression.Subquery.Scalar", repeated = FALSE), + in_predicate = clean_value(in_predicate, "TYPE_MESSAGE", "substrait.Expression.Subquery.InPredicate", repeated = FALSE), + set_predicate = clean_value(set_predicate, "TYPE_MESSAGE", "substrait.Expression.Subquery.SetPredicate", repeated = FALSE), + set_comparison = clean_value(set_comparison, "TYPE_MESSAGE", "substrait.Expression.Subquery.SetComparison", repeated = FALSE), + .qualified_name = "substrait.Expression.Subquery" + ) + } + ), SwitchExpression = list( IfValue = list( create = function(..., if_ = unspecified(), then = unspecified()) { @@ -471,9 +693,10 @@ substrait <- list( ) } ), - create = function(..., ifs = unspecified(), else_ = unspecified()) { + create = function(..., match = unspecified(), ifs = unspecified(), else_ = unspecified()) { rlang::check_dots_empty() create_substrait_message( + match = clean_value(match, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), ifs = clean_value(ifs, "TYPE_MESSAGE", "substrait.Expression.SwitchExpression.IfValue", repeated = TRUE), else_ = clean_value(else_, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), .qualified_name = "substrait.Expression.SwitchExpression" @@ -523,7 +746,7 @@ substrait <- list( ) } ), - create = function(..., function_reference = unspecified(), partitions = unspecified(), sorts = unspecified(), upper_bound = unspecified(), lower_bound = unspecified(), phase = unspecified(), output_type = unspecified(), args = unspecified()) { + create = function(..., function_reference = unspecified(), partitions = unspecified(), sorts = unspecified(), upper_bound = unspecified(), lower_bound = unspecified(), phase = unspecified(), output_type = unspecified(), arguments = unspecified(), args = unspecified()) { rlang::check_dots_empty() create_substrait_message( function_reference = clean_value(function_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), @@ -533,12 +756,13 @@ substrait <- list( lower_bound = clean_value(lower_bound, "TYPE_MESSAGE", "substrait.Expression.WindowFunction.Bound", repeated = FALSE), phase = clean_value(phase, "TYPE_ENUM", "substrait.AggregationPhase", repeated = FALSE), output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), + arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionArgument", repeated = TRUE), args = clean_value(args, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), .qualified_name = "substrait.Expression.WindowFunction" ) } ), - create = function(..., literal = unspecified(), selection = unspecified(), scalar_function = unspecified(), window_function = unspecified(), if_then = unspecified(), switch_expression = unspecified(), singular_or_list = unspecified(), multi_or_list = unspecified(), enum_ = unspecified(), cast = unspecified()) { + create = function(..., literal = unspecified(), selection = unspecified(), scalar_function = unspecified(), window_function = unspecified(), if_then = unspecified(), switch_expression = unspecified(), singular_or_list = unspecified(), multi_or_list = unspecified(), cast = unspecified(), subquery = unspecified(), enum_ = unspecified()) { rlang::check_dots_empty() create_substrait_message( literal = clean_value(literal, "TYPE_MESSAGE", "substrait.Expression.Literal", repeated = FALSE), @@ -549,732 +773,786 @@ substrait <- list( switch_expression = clean_value(switch_expression, "TYPE_MESSAGE", "substrait.Expression.SwitchExpression", repeated = FALSE), singular_or_list = clean_value(singular_or_list, "TYPE_MESSAGE", "substrait.Expression.SingularOrList", repeated = FALSE), multi_or_list = clean_value(multi_or_list, "TYPE_MESSAGE", "substrait.Expression.MultiOrList", repeated = FALSE), - enum_ = clean_value(enum_, "TYPE_MESSAGE", "substrait.Expression.Enum", repeated = FALSE), cast = clean_value(cast, "TYPE_MESSAGE", "substrait.Expression.Cast", repeated = FALSE), + subquery = clean_value(subquery, "TYPE_MESSAGE", "substrait.Expression.Subquery", repeated = FALSE), + enum_ = clean_value(enum_, "TYPE_MESSAGE", "substrait.Expression.Enum", repeated = FALSE), .qualified_name = "substrait.Expression" ) } ), - SortField = list( - SortDirection = list( - SORT_DIRECTION_UNSPECIFIED = structure(0L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), - SORT_DIRECTION_ASC_NULLS_FIRST = structure(1L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), - SORT_DIRECTION_ASC_NULLS_LAST = structure(2L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), - SORT_DIRECTION_DESC_NULLS_FIRST = structure(3L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), - SORT_DIRECTION_DESC_NULLS_LAST = structure(4L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), - SORT_DIRECTION_CLUSTERED = structure(5L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.SortField.SortDirection" + ExtensionLeafRel = list( + create = function(..., common = unspecified(), detail = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.ExtensionLeafRel" + ) + } + ), + ExtensionMultiRel = list( + create = function(..., common = unspecified(), inputs = unspecified(), detail = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + inputs = clean_value(inputs, "TYPE_MESSAGE", "substrait.Rel", repeated = TRUE), + detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.ExtensionMultiRel" + ) + } + ), + ExtensionSingleRel = list( + create = function(..., common = unspecified(), input = unspecified(), detail = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.ExtensionSingleRel" + ) + } + ), + FetchRel = list( + create = function(..., common = unspecified(), input = unspecified(), offset = unspecified(), count = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + offset = clean_value(offset, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), + count = clean_value(count, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.FetchRel" + ) + } + ), + FilterRel = list( + create = function(..., common = unspecified(), input = unspecified(), condition = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + condition = clean_value(condition, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.FilterRel" + ) + } + ), + FunctionArgument = list( + Enum = list( + create = function(..., specified = unspecified(), unspecified = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + specified = clean_value(specified, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + unspecified = clean_value(unspecified, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.FunctionArgument.Enum" ) } ), - create = function(..., expr = unspecified(), direction = unspecified(), comparison_function_reference = unspecified()) { + create = function(..., enum_ = unspecified(), type = unspecified(), value = unspecified()) { rlang::check_dots_empty() create_substrait_message( - expr = clean_value(expr, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), - direction = clean_value(direction, "TYPE_ENUM", "substrait.SortField.SortDirection", repeated = FALSE), - comparison_function_reference = clean_value(comparison_function_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - .qualified_name = "substrait.SortField" + enum_ = clean_value(enum_, "TYPE_MESSAGE", "substrait.FunctionArgument.Enum", repeated = FALSE), + type = clean_value(type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), + value = clean_value(value, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + .qualified_name = "substrait.FunctionArgument" ) } ), - FunctionSignature = list( - Aggregate = list( - create = function(..., arguments = unspecified(), name = unspecified(), description = unspecified(), deterministic = unspecified(), session_dependent = unspecified(), output_type = unspecified(), variadic = unspecified(), normal = unspecified(), ordered = unspecified(), max_set = unspecified(), intermediate_type = unspecified(), implementations = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument", repeated = TRUE), - name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - description = clean_value(description, "TYPE_MESSAGE", "substrait.FunctionSignature.Description", repeated = FALSE), - deterministic = clean_value(deterministic, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - session_dependent = clean_value(session_dependent, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), - variadic = clean_value(variadic, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgVariadic", repeated = FALSE), - normal = clean_value(normal, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgNormal", repeated = FALSE), - ordered = clean_value(ordered, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - max_set = clean_value(max_set, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), - intermediate_type = clean_value(intermediate_type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), - implementations = clean_value(implementations, "TYPE_MESSAGE", "substrait.FunctionSignature.Implementation", repeated = TRUE), - .qualified_name = "substrait.FunctionSignature.Aggregate" + JoinRel = list( + JoinType = list( + JOIN_TYPE_UNSPECIFIED = structure(0L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_INNER = structure(1L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_OUTER = structure(2L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_LEFT = structure(3L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_RIGHT = structure(4L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_SEMI = structure(5L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_ANTI = structure(6L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + JOIN_TYPE_SINGLE = structure(7L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.JoinRel.JoinType" ) } ), - Argument = list( - EnumArgument = list( - create = function(..., options = unspecified(), optional = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - options = clean_value(options, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - optional = clean_value(optional, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.Argument.EnumArgument" - ) - } - ), - TypeArgument = list( - create = function(..., type = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - type = clean_value(type, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.Argument.TypeArgument" - ) - } - ), - ValueArgument = list( - create = function(..., type = unspecified(), constant = unspecified()) { + create = function(..., common = unspecified(), left = unspecified(), right = unspecified(), expression = unspecified(), post_join_filter = unspecified(), type = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + left = clean_value(left, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + right = clean_value(right, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + expression = clean_value(expression, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + post_join_filter = clean_value(post_join_filter, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + type = clean_value(type, "TYPE_ENUM", "substrait.JoinRel.JoinType", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.JoinRel" + ) + } + ), + ProjectRel = list( + create = function(..., common = unspecified(), input = unspecified(), expressions = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + expressions = clean_value(expressions, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.ProjectRel" + ) + } + ), + ReadRel = list( + ExtensionTable = list( + create = function(..., detail = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.ReadRel.ExtensionTable" + ) + } + ), + LocalFiles = list( + FileOrFiles = list( + ArrowReadOptions = list( + create = function(...) { + rlang::check_dots_empty() + create_substrait_message(.qualified_name = "substrait.ReadRel.LocalFiles.FileOrFiles.ArrowReadOptions") + } + ), + OrcReadOptions = list( + create = function(...) { + rlang::check_dots_empty() + create_substrait_message(.qualified_name = "substrait.ReadRel.LocalFiles.FileOrFiles.OrcReadOptions") + } + ), + ParquetReadOptions = list( + create = function(...) { + rlang::check_dots_empty() + create_substrait_message(.qualified_name = "substrait.ReadRel.LocalFiles.FileOrFiles.ParquetReadOptions") + } + ), + create = function(..., uri_path = unspecified(), uri_path_glob = unspecified(), uri_file = unspecified(), uri_folder = unspecified(), partition_index = unspecified(), start = unspecified(), length = unspecified(), parquet = unspecified(), arrow = unspecified(), orc = unspecified(), extension = unspecified()) { rlang::check_dots_empty() create_substrait_message( - type = clean_value(type, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), - constant = clean_value(constant, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.Argument.ValueArgument" + uri_path = clean_value(uri_path, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + uri_path_glob = clean_value(uri_path_glob, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + uri_file = clean_value(uri_file, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + uri_folder = clean_value(uri_folder, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + partition_index = clean_value(partition_index, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), + start = clean_value(start, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), + length = clean_value(length, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), + parquet = clean_value(parquet, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles.FileOrFiles.ParquetReadOptions", repeated = FALSE), + arrow = clean_value(arrow, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles.FileOrFiles.ArrowReadOptions", repeated = FALSE), + orc = clean_value(orc, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles.FileOrFiles.OrcReadOptions", repeated = FALSE), + extension = clean_value(extension, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), + .qualified_name = "substrait.ReadRel.LocalFiles.FileOrFiles" ) } ), - create = function(..., name = unspecified(), value = unspecified(), type = unspecified(), enum_ = unspecified()) { + create = function(..., items = unspecified(), advanced_extension = unspecified()) { rlang::check_dots_empty() create_substrait_message( - name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - value = clean_value(value, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument.ValueArgument", repeated = FALSE), - type = clean_value(type, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument.TypeArgument", repeated = FALSE), - enum_ = clean_value(enum_, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument.EnumArgument", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.Argument" + items = clean_value(items, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles.FileOrFiles", repeated = TRUE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.ReadRel.LocalFiles" ) } ), - Description = list( - create = function(..., language = unspecified(), body = unspecified()) { + NamedTable = list( + create = function(..., names = unspecified(), advanced_extension = unspecified()) { rlang::check_dots_empty() create_substrait_message( - language = clean_value(language, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - body = clean_value(body, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.Description" + names = clean_value(names, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.ReadRel.NamedTable" ) } ), - FinalArgNormal = list( - create = function(...) { - rlang::check_dots_empty() - create_substrait_message(.qualified_name = "substrait.FunctionSignature.FinalArgNormal") - } - ), - FinalArgVariadic = list( - ParameterConsistency = list( - PARAMETER_CONSISTENCY_UNSPECIFIED = structure(0L, class = c("substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency", "substrait_proto_enum", "substrait_proto")), - PARAMETER_CONSISTENCY_CONSISTENT = structure(1L, class = c("substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency", "substrait_proto_enum", "substrait_proto")), - PARAMETER_CONSISTENCY_INCONSISTENT = structure(2L, class = c("substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.FunctionSignature.FinalArgVariadic.ParameterConsistency" - ) - } - ), - create = function(..., min_args = unspecified(), max_args = unspecified(), consistency = unspecified()) { + VirtualTable = list( + create = function(..., values = unspecified()) { rlang::check_dots_empty() create_substrait_message( - min_args = clean_value(min_args, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), - max_args = clean_value(max_args, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), - consistency = clean_value(consistency, "TYPE_ENUM", "substrait.FunctionSignature.FinalArgVariadic.ParameterConsistency", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.FinalArgVariadic" + values = clean_value(values, "TYPE_MESSAGE", "substrait.Expression.Literal.Struct", repeated = TRUE), + .qualified_name = "substrait.ReadRel.VirtualTable" ) } ), - Implementation = list( - Type = list( - TYPE_UNSPECIFIED = structure(0L, class = c("substrait_FunctionSignature_Implementation_Type", "substrait_proto_enum", "substrait_proto")), - TYPE_WEB_ASSEMBLY = structure(1L, class = c("substrait_FunctionSignature_Implementation_Type", "substrait_proto_enum", "substrait_proto")), - TYPE_TRINO_JAR = structure(2L, class = c("substrait_FunctionSignature_Implementation_Type", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.FunctionSignature.Implementation.Type" - ) - } - ), - create = function(..., type = unspecified(), uri = unspecified()) { + create = function(..., common = unspecified(), base_schema = unspecified(), filter = unspecified(), projection = unspecified(), advanced_extension = unspecified(), virtual_table = unspecified(), local_files = unspecified(), named_table = unspecified(), extension_table = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + base_schema = clean_value(base_schema, "TYPE_MESSAGE", "substrait.NamedStruct", repeated = FALSE), + filter = clean_value(filter, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + projection = clean_value(projection, "TYPE_MESSAGE", "substrait.Expression.MaskExpression", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + virtual_table = clean_value(virtual_table, "TYPE_MESSAGE", "substrait.ReadRel.VirtualTable", repeated = FALSE), + local_files = clean_value(local_files, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles", repeated = FALSE), + named_table = clean_value(named_table, "TYPE_MESSAGE", "substrait.ReadRel.NamedTable", repeated = FALSE), + extension_table = clean_value(extension_table, "TYPE_MESSAGE", "substrait.ReadRel.ExtensionTable", repeated = FALSE), + .qualified_name = "substrait.ReadRel" + ) + } + ), + Rel = list( + create = function(..., read = unspecified(), filter = unspecified(), fetch = unspecified(), aggregate = unspecified(), sort = unspecified(), join = unspecified(), project = unspecified(), set = unspecified(), extension_single = unspecified(), extension_multi = unspecified(), extension_leaf = unspecified(), cross = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + read = clean_value(read, "TYPE_MESSAGE", "substrait.ReadRel", repeated = FALSE), + filter = clean_value(filter, "TYPE_MESSAGE", "substrait.FilterRel", repeated = FALSE), + fetch = clean_value(fetch, "TYPE_MESSAGE", "substrait.FetchRel", repeated = FALSE), + aggregate = clean_value(aggregate, "TYPE_MESSAGE", "substrait.AggregateRel", repeated = FALSE), + sort = clean_value(sort, "TYPE_MESSAGE", "substrait.SortRel", repeated = FALSE), + join = clean_value(join, "TYPE_MESSAGE", "substrait.JoinRel", repeated = FALSE), + project = clean_value(project, "TYPE_MESSAGE", "substrait.ProjectRel", repeated = FALSE), + set = clean_value(set, "TYPE_MESSAGE", "substrait.SetRel", repeated = FALSE), + extension_single = clean_value(extension_single, "TYPE_MESSAGE", "substrait.ExtensionSingleRel", repeated = FALSE), + extension_multi = clean_value(extension_multi, "TYPE_MESSAGE", "substrait.ExtensionMultiRel", repeated = FALSE), + extension_leaf = clean_value(extension_leaf, "TYPE_MESSAGE", "substrait.ExtensionLeafRel", repeated = FALSE), + cross = clean_value(cross, "TYPE_MESSAGE", "substrait.CrossRel", repeated = FALSE), + .qualified_name = "substrait.Rel" + ) + } + ), + RelCommon = list( + Direct = list( + create = function(...) { rlang::check_dots_empty() - create_substrait_message( - type = clean_value(type, "TYPE_ENUM", "substrait.FunctionSignature.Implementation.Type", repeated = FALSE), - uri = clean_value(uri, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - .qualified_name = "substrait.FunctionSignature.Implementation" - ) + create_substrait_message(.qualified_name = "substrait.RelCommon.Direct") } ), - Scalar = list( - create = function(..., arguments = unspecified(), name = unspecified(), description = unspecified(), deterministic = unspecified(), session_dependent = unspecified(), output_type = unspecified(), variadic = unspecified(), normal = unspecified(), implementations = unspecified()) { + Emit = list( + create = function(..., output_mapping = unspecified()) { rlang::check_dots_empty() create_substrait_message( - arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument", repeated = TRUE), - name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - description = clean_value(description, "TYPE_MESSAGE", "substrait.FunctionSignature.Description", repeated = FALSE), - deterministic = clean_value(deterministic, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - session_dependent = clean_value(session_dependent, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), - variadic = clean_value(variadic, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgVariadic", repeated = FALSE), - normal = clean_value(normal, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgNormal", repeated = FALSE), - implementations = clean_value(implementations, "TYPE_MESSAGE", "substrait.FunctionSignature.Implementation", repeated = TRUE), - .qualified_name = "substrait.FunctionSignature.Scalar" + output_mapping = clean_value(output_mapping, "TYPE_INT32", "TYPE_INT32", repeated = TRUE), + .qualified_name = "substrait.RelCommon.Emit" ) } ), - Window = list( - WindowType = list( - WINDOW_TYPE_UNSPECIFIED = structure(0L, class = c("substrait_FunctionSignature_Window_WindowType", "substrait_proto_enum", "substrait_proto")), - WINDOW_TYPE_STREAMING = structure(1L, class = c("substrait_FunctionSignature_Window_WindowType", "substrait_proto_enum", "substrait_proto")), - WINDOW_TYPE_PARTITION = structure(2L, class = c("substrait_FunctionSignature_Window_WindowType", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.FunctionSignature.Window.WindowType" + Hint = list( + RuntimeConstraint = list( + create = function(..., advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.RelCommon.Hint.RuntimeConstraint" ) } ), - create = function(..., arguments = unspecified(), name = unspecified(), description = unspecified(), deterministic = unspecified(), session_dependent = unspecified(), intermediate_type = unspecified(), output_type = unspecified(), variadic = unspecified(), normal = unspecified(), ordered = unspecified(), max_set = unspecified(), window_type = unspecified(), implementations = unspecified()) { + Stats = list( + create = function(..., row_count = unspecified(), record_size = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + row_count = clean_value(row_count, "TYPE_DOUBLE", "TYPE_DOUBLE", repeated = FALSE), + record_size = clean_value(record_size, "TYPE_DOUBLE", "TYPE_DOUBLE", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.RelCommon.Hint.Stats" + ) + } + ), + create = function(..., stats = unspecified(), constraint = unspecified(), advanced_extension = unspecified()) { rlang::check_dots_empty() create_substrait_message( - arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument", repeated = TRUE), - name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - description = clean_value(description, "TYPE_MESSAGE", "substrait.FunctionSignature.Description", repeated = FALSE), - deterministic = clean_value(deterministic, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - session_dependent = clean_value(session_dependent, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - intermediate_type = clean_value(intermediate_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), - output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), - variadic = clean_value(variadic, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgVariadic", repeated = FALSE), - normal = clean_value(normal, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgNormal", repeated = FALSE), - ordered = clean_value(ordered, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), - max_set = clean_value(max_set, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), - window_type = clean_value(window_type, "TYPE_ENUM", "substrait.FunctionSignature.Window.WindowType", repeated = FALSE), - implementations = clean_value(implementations, "TYPE_MESSAGE", "substrait.FunctionSignature.Implementation", repeated = TRUE), - .qualified_name = "substrait.FunctionSignature.Window" + stats = clean_value(stats, "TYPE_MESSAGE", "substrait.RelCommon.Hint.Stats", repeated = FALSE), + constraint = clean_value(constraint, "TYPE_MESSAGE", "substrait.RelCommon.Hint.RuntimeConstraint", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.RelCommon.Hint" ) } ), - create = function(...) { + create = function(..., direct = unspecified(), emit = unspecified(), hint = unspecified(), advanced_extension = unspecified()) { rlang::check_dots_empty() - create_substrait_message(.qualified_name = "substrait.FunctionSignature") + create_substrait_message( + direct = clean_value(direct, "TYPE_MESSAGE", "substrait.RelCommon.Direct", repeated = FALSE), + emit = clean_value(emit, "TYPE_MESSAGE", "substrait.RelCommon.Emit", repeated = FALSE), + hint = clean_value(hint, "TYPE_MESSAGE", "substrait.RelCommon.Hint", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.RelCommon" + ) } ), - ParameterizedType = list( - IntegerOption = list( - create = function(..., literal = unspecified(), parameter = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - literal = clean_value(literal, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), - parameter = clean_value(parameter, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerParameter", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.IntegerOption" + RelRoot = list( + create = function(..., input = unspecified(), names = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + names = clean_value(names, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + .qualified_name = "substrait.RelRoot" + ) + } + ), + SetRel = list( + SetOp = list( + SET_OP_UNSPECIFIED = structure(0L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + SET_OP_MINUS_PRIMARY = structure(1L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + SET_OP_MINUS_MULTISET = structure(2L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + SET_OP_INTERSECTION_PRIMARY = structure(3L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + SET_OP_INTERSECTION_MULTISET = structure(4L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + SET_OP_UNION_DISTINCT = structure(5L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + SET_OP_UNION_ALL = structure(6L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.SetRel.SetOp" ) } ), - IntegerParameter = list( - create = function(..., name = unspecified(), range_start_inclusive = unspecified(), range_end_exclusive = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - range_start_inclusive = clean_value(range_start_inclusive, "TYPE_MESSAGE", "substrait.ParameterizedType.NullableInteger", repeated = FALSE), - range_end_exclusive = clean_value(range_end_exclusive, "TYPE_MESSAGE", "substrait.ParameterizedType.NullableInteger", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.IntegerParameter" + create = function(..., common = unspecified(), inputs = unspecified(), op = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + inputs = clean_value(inputs, "TYPE_MESSAGE", "substrait.Rel", repeated = TRUE), + op = clean_value(op, "TYPE_ENUM", "substrait.SetRel.SetOp", repeated = FALSE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.SetRel" + ) + } + ), + SortField = list( + SortDirection = list( + SORT_DIRECTION_UNSPECIFIED = structure(0L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), + SORT_DIRECTION_ASC_NULLS_FIRST = structure(1L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), + SORT_DIRECTION_ASC_NULLS_LAST = structure(2L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), + SORT_DIRECTION_DESC_NULLS_FIRST = structure(3L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), + SORT_DIRECTION_DESC_NULLS_LAST = structure(4L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), + SORT_DIRECTION_CLUSTERED = structure(5L, class = c("substrait_SortField_SortDirection", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.SortField.SortDirection" ) } ), - NullableInteger = list( - create = function(..., value = unspecified()) { + create = function(..., expr = unspecified(), direction = unspecified(), comparison_function_reference = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + expr = clean_value(expr, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), + direction = clean_value(direction, "TYPE_ENUM", "substrait.SortField.SortDirection", repeated = FALSE), + comparison_function_reference = clean_value(comparison_function_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + .qualified_name = "substrait.SortField" + ) + } + ), + SortRel = list( + create = function(..., common = unspecified(), input = unspecified(), sorts = unspecified(), advanced_extension = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), + input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + sorts = clean_value(sorts, "TYPE_MESSAGE", "substrait.SortField", repeated = TRUE), + advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + .qualified_name = "substrait.SortRel" + ) + } + ), + Any = list( + create = function(..., type_url = unspecified(), value = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + type_url = clean_value(type_url, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + value = clean_value(value, "TYPE_BYTES", "TYPE_BYTES", repeated = FALSE), + .qualified_name = "substrait.Any" + ) + } + ), + Empty = list( + create = function(...) { + rlang::check_dots_empty() + create_substrait_message(.qualified_name = "substrait.Empty") + } + ), + Capabilities = list( + SimpleExtension = list( + create = function(..., uri = unspecified(), function_keys = unspecified(), type_keys = unspecified(), type_variation_keys = unspecified()) { rlang::check_dots_empty() create_substrait_message( - value = clean_value(value, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.NullableInteger" + uri = clean_value(uri, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + function_keys = clean_value(function_keys, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + type_keys = clean_value(type_keys, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + type_variation_keys = clean_value(type_variation_keys, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + .qualified_name = "substrait.Capabilities.SimpleExtension" ) } ), - ParameterizedDecimal = list( - create = function(..., scale = unspecified(), precision = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + create = function(..., substrait_versions = unspecified(), advanced_extension_type_urls = unspecified(), simple_extensions = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + substrait_versions = clean_value(substrait_versions, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + advanced_extension_type_urls = clean_value(advanced_extension_type_urls, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + simple_extensions = clean_value(simple_extensions, "TYPE_MESSAGE", "substrait.Capabilities.SimpleExtension", repeated = TRUE), + .qualified_name = "substrait.Capabilities" + ) + } + ), + FunctionSignature = list( + Aggregate = list( + create = function(..., arguments = unspecified(), name = unspecified(), description = unspecified(), deterministic = unspecified(), session_dependent = unspecified(), output_type = unspecified(), variadic = unspecified(), normal = unspecified(), ordered = unspecified(), max_set = unspecified(), intermediate_type = unspecified(), implementations = unspecified()) { rlang::check_dots_empty() create_substrait_message( - scale = clean_value(scale, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), - precision = clean_value(precision, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedDecimal" + arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument", repeated = TRUE), + name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + description = clean_value(description, "TYPE_MESSAGE", "substrait.FunctionSignature.Description", repeated = FALSE), + deterministic = clean_value(deterministic, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + session_dependent = clean_value(session_dependent, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), + variadic = clean_value(variadic, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgVariadic", repeated = FALSE), + normal = clean_value(normal, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgNormal", repeated = FALSE), + ordered = clean_value(ordered, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + max_set = clean_value(max_set, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), + intermediate_type = clean_value(intermediate_type, "TYPE_MESSAGE", "substrait.Type", repeated = FALSE), + implementations = clean_value(implementations, "TYPE_MESSAGE", "substrait.FunctionSignature.Implementation", repeated = TRUE), + .qualified_name = "substrait.FunctionSignature.Aggregate" ) } ), - ParameterizedFixedBinary = list( - create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + Argument = list( + EnumArgument = list( + create = function(..., options = unspecified(), optional = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + options = clean_value(options, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + optional = clean_value(optional, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.Argument.EnumArgument" + ) + } + ), + TypeArgument = list( + create = function(..., type = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + type = clean_value(type, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.Argument.TypeArgument" + ) + } + ), + ValueArgument = list( + create = function(..., type = unspecified(), constant = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + type = clean_value(type, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), + constant = clean_value(constant, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.Argument.ValueArgument" + ) + } + ), + create = function(..., name = unspecified(), value = unspecified(), type = unspecified(), enum_ = unspecified()) { rlang::check_dots_empty() create_substrait_message( - length = clean_value(length, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedFixedBinary" + name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + value = clean_value(value, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument.ValueArgument", repeated = FALSE), + type = clean_value(type, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument.TypeArgument", repeated = FALSE), + enum_ = clean_value(enum_, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument.EnumArgument", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.Argument" ) } ), - ParameterizedFixedChar = list( - create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + Description = list( + create = function(..., language = unspecified(), body = unspecified()) { rlang::check_dots_empty() create_substrait_message( - length = clean_value(length, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedFixedChar" + language = clean_value(language, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + body = clean_value(body, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.Description" ) } ), - ParameterizedList = list( - create = function(..., type = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + FinalArgNormal = list( + create = function(...) { rlang::check_dots_empty() - create_substrait_message( - type = clean_value(type, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedList" - ) + create_substrait_message(.qualified_name = "substrait.FunctionSignature.FinalArgNormal") } ), - ParameterizedMap = list( - create = function(..., key = unspecified(), value = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + FinalArgVariadic = list( + ParameterConsistency = list( + PARAMETER_CONSISTENCY_UNSPECIFIED = structure(0L, class = c("substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency", "substrait_proto_enum", "substrait_proto")), + PARAMETER_CONSISTENCY_CONSISTENT = structure(1L, class = c("substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency", "substrait_proto_enum", "substrait_proto")), + PARAMETER_CONSISTENCY_INCONSISTENT = structure(2L, class = c("substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.FunctionSignature.FinalArgVariadic.ParameterConsistency" + ) + } + ), + create = function(..., min_args = unspecified(), max_args = unspecified(), consistency = unspecified()) { rlang::check_dots_empty() create_substrait_message( - key = clean_value(key, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), - value = clean_value(value, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedMap" - ) - } - ), - ParameterizedNamedStruct = list( - create = function(..., names = unspecified(), struct_ = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - names = clean_value(names, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - struct_ = clean_value(struct_, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedStruct", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedNamedStruct" + min_args = clean_value(min_args, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), + max_args = clean_value(max_args, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), + consistency = clean_value(consistency, "TYPE_ENUM", "substrait.FunctionSignature.FinalArgVariadic.ParameterConsistency", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.FinalArgVariadic" ) } ), - ParameterizedStruct = list( - create = function(..., types = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + Implementation = list( + Type = list( + TYPE_UNSPECIFIED = structure(0L, class = c("substrait_FunctionSignature_Implementation_Type", "substrait_proto_enum", "substrait_proto")), + TYPE_WEB_ASSEMBLY = structure(1L, class = c("substrait_FunctionSignature_Implementation_Type", "substrait_proto_enum", "substrait_proto")), + TYPE_TRINO_JAR = structure(2L, class = c("substrait_FunctionSignature_Implementation_Type", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.FunctionSignature.Implementation.Type" + ) + } + ), + create = function(..., type = unspecified(), uri = unspecified()) { rlang::check_dots_empty() create_substrait_message( - types = clean_value(types, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = TRUE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedStruct" + type = clean_value(type, "TYPE_ENUM", "substrait.FunctionSignature.Implementation.Type", repeated = FALSE), + uri = clean_value(uri, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + .qualified_name = "substrait.FunctionSignature.Implementation" ) } ), - ParameterizedVarChar = list( - create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + Scalar = list( + create = function(..., arguments = unspecified(), name = unspecified(), description = unspecified(), deterministic = unspecified(), session_dependent = unspecified(), output_type = unspecified(), variadic = unspecified(), normal = unspecified(), implementations = unspecified()) { rlang::check_dots_empty() create_substrait_message( - length = clean_value(length, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), - variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType.ParameterizedVarChar" + arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument", repeated = TRUE), + name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + description = clean_value(description, "TYPE_MESSAGE", "substrait.FunctionSignature.Description", repeated = FALSE), + deterministic = clean_value(deterministic, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + session_dependent = clean_value(session_dependent, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), + variadic = clean_value(variadic, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgVariadic", repeated = FALSE), + normal = clean_value(normal, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgNormal", repeated = FALSE), + implementations = clean_value(implementations, "TYPE_MESSAGE", "substrait.FunctionSignature.Implementation", repeated = TRUE), + .qualified_name = "substrait.FunctionSignature.Scalar" ) } ), - TypeParameter = list( - create = function(..., name = unspecified(), bounds = unspecified()) { + Window = list( + WindowType = list( + WINDOW_TYPE_UNSPECIFIED = structure(0L, class = c("substrait_FunctionSignature_Window_WindowType", "substrait_proto_enum", "substrait_proto")), + WINDOW_TYPE_STREAMING = structure(1L, class = c("substrait_FunctionSignature_Window_WindowType", "substrait_proto_enum", "substrait_proto")), + WINDOW_TYPE_PARTITION = structure(2L, class = c("substrait_FunctionSignature_Window_WindowType", "substrait_proto_enum", "substrait_proto")), + create = function(value) { + create_substrait_enum( + value, + .qualified_name = "substrait.FunctionSignature.Window.WindowType" + ) + } + ), + create = function(..., arguments = unspecified(), name = unspecified(), description = unspecified(), deterministic = unspecified(), session_dependent = unspecified(), intermediate_type = unspecified(), output_type = unspecified(), variadic = unspecified(), normal = unspecified(), ordered = unspecified(), max_set = unspecified(), window_type = unspecified(), implementations = unspecified()) { rlang::check_dots_empty() create_substrait_message( - name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - bounds = clean_value(bounds, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = TRUE), - .qualified_name = "substrait.ParameterizedType.TypeParameter" + arguments = clean_value(arguments, "TYPE_MESSAGE", "substrait.FunctionSignature.Argument", repeated = TRUE), + name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + description = clean_value(description, "TYPE_MESSAGE", "substrait.FunctionSignature.Description", repeated = FALSE), + deterministic = clean_value(deterministic, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + session_dependent = clean_value(session_dependent, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + intermediate_type = clean_value(intermediate_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), + output_type = clean_value(output_type, "TYPE_MESSAGE", "substrait.DerivationExpression", repeated = FALSE), + variadic = clean_value(variadic, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgVariadic", repeated = FALSE), + normal = clean_value(normal, "TYPE_MESSAGE", "substrait.FunctionSignature.FinalArgNormal", repeated = FALSE), + ordered = clean_value(ordered, "TYPE_BOOL", "TYPE_BOOL", repeated = FALSE), + max_set = clean_value(max_set, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), + window_type = clean_value(window_type, "TYPE_ENUM", "substrait.FunctionSignature.Window.WindowType", repeated = FALSE), + implementations = clean_value(implementations, "TYPE_MESSAGE", "substrait.FunctionSignature.Implementation", repeated = TRUE), + .qualified_name = "substrait.FunctionSignature.Window" ) } ), - create = function(..., bool_ = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year = unspecified(), interval_day = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), fixed_char = unspecified(), varchar = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), list = unspecified(), map = unspecified(), user_defined_pointer = unspecified(), type_parameter = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - bool_ = clean_value(bool_, "TYPE_MESSAGE", "substrait.Type.Boolean", repeated = FALSE), - i8 = clean_value(i8, "TYPE_MESSAGE", "substrait.Type.I8", repeated = FALSE), - i16 = clean_value(i16, "TYPE_MESSAGE", "substrait.Type.I16", repeated = FALSE), - i32 = clean_value(i32, "TYPE_MESSAGE", "substrait.Type.I32", repeated = FALSE), - i64 = clean_value(i64, "TYPE_MESSAGE", "substrait.Type.I64", repeated = FALSE), - fp32 = clean_value(fp32, "TYPE_MESSAGE", "substrait.Type.FP32", repeated = FALSE), - fp64 = clean_value(fp64, "TYPE_MESSAGE", "substrait.Type.FP64", repeated = FALSE), - string = clean_value(string, "TYPE_MESSAGE", "substrait.Type.String", repeated = FALSE), - binary = clean_value(binary, "TYPE_MESSAGE", "substrait.Type.Binary", repeated = FALSE), - timestamp = clean_value(timestamp, "TYPE_MESSAGE", "substrait.Type.Timestamp", repeated = FALSE), - date = clean_value(date, "TYPE_MESSAGE", "substrait.Type.Date", repeated = FALSE), - time = clean_value(time, "TYPE_MESSAGE", "substrait.Type.Time", repeated = FALSE), - interval_year = clean_value(interval_year, "TYPE_MESSAGE", "substrait.Type.IntervalYear", repeated = FALSE), - interval_day = clean_value(interval_day, "TYPE_MESSAGE", "substrait.Type.IntervalDay", repeated = FALSE), - timestamp_tz = clean_value(timestamp_tz, "TYPE_MESSAGE", "substrait.Type.TimestampTZ", repeated = FALSE), - uuid = clean_value(uuid, "TYPE_MESSAGE", "substrait.Type.UUID", repeated = FALSE), - fixed_char = clean_value(fixed_char, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedFixedChar", repeated = FALSE), - varchar = clean_value(varchar, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedVarChar", repeated = FALSE), - fixed_binary = clean_value(fixed_binary, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedFixedBinary", repeated = FALSE), - decimal = clean_value(decimal, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedDecimal", repeated = FALSE), - struct_ = clean_value(struct_, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedStruct", repeated = FALSE), - list = clean_value(list, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedList", repeated = FALSE), - map = clean_value(map, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedMap", repeated = FALSE), - user_defined_pointer = clean_value(user_defined_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), - type_parameter = clean_value(type_parameter, "TYPE_MESSAGE", "substrait.ParameterizedType.TypeParameter", repeated = FALSE), - .qualified_name = "substrait.ParameterizedType" - ) - } - ), - Plan = list( - create = function(..., extension_uris = unspecified(), extensions = unspecified(), relations = unspecified(), advanced_extensions = unspecified(), expected_type_urls = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - extension_uris = clean_value(extension_uris, "TYPE_MESSAGE", "substrait.extensions.SimpleExtensionURI", repeated = TRUE), - extensions = clean_value(extensions, "TYPE_MESSAGE", "substrait.extensions.SimpleExtensionDeclaration", repeated = TRUE), - relations = clean_value(relations, "TYPE_MESSAGE", "substrait.PlanRel", repeated = TRUE), - advanced_extensions = clean_value(advanced_extensions, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - expected_type_urls = clean_value(expected_type_urls, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - .qualified_name = "substrait.Plan" - ) - } - ), - PlanRel = list( - create = function(..., rel = unspecified(), root = unspecified()) { + create = function(...) { rlang::check_dots_empty() - create_substrait_message( - rel = clean_value(rel, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - root = clean_value(root, "TYPE_MESSAGE", "substrait.RelRoot", repeated = FALSE), - .qualified_name = "substrait.PlanRel" - ) + create_substrait_message(.qualified_name = "substrait.FunctionSignature") } ), - AggregateRel = list( - Grouping = list( - create = function(..., grouping_expressions = unspecified()) { + ParameterizedType = list( + IntegerOption = list( + create = function(..., literal = unspecified(), parameter = unspecified()) { rlang::check_dots_empty() create_substrait_message( - grouping_expressions = clean_value(grouping_expressions, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), - .qualified_name = "substrait.AggregateRel.Grouping" + literal = clean_value(literal, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), + parameter = clean_value(parameter, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerParameter", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.IntegerOption" ) } ), - Measure = list( - create = function(..., measure = unspecified(), filter = unspecified()) { + IntegerParameter = list( + create = function(..., name = unspecified(), range_start_inclusive = unspecified(), range_end_exclusive = unspecified()) { rlang::check_dots_empty() create_substrait_message( - measure = clean_value(measure, "TYPE_MESSAGE", "substrait.AggregateFunction", repeated = FALSE), - filter = clean_value(filter, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), - .qualified_name = "substrait.AggregateRel.Measure" + name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + range_start_inclusive = clean_value(range_start_inclusive, "TYPE_MESSAGE", "substrait.ParameterizedType.NullableInteger", repeated = FALSE), + range_end_exclusive = clean_value(range_end_exclusive, "TYPE_MESSAGE", "substrait.ParameterizedType.NullableInteger", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.IntegerParameter" ) } ), - create = function(..., common = unspecified(), input = unspecified(), groupings = unspecified(), measures = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - groupings = clean_value(groupings, "TYPE_MESSAGE", "substrait.AggregateRel.Grouping", repeated = TRUE), - measures = clean_value(measures, "TYPE_MESSAGE", "substrait.AggregateRel.Measure", repeated = TRUE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.AggregateRel" - ) - } - ), - ExtensionLeafRel = list( - create = function(..., common = unspecified(), detail = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), - .qualified_name = "substrait.ExtensionLeafRel" - ) - } - ), - ExtensionMultiRel = list( - create = function(..., common = unspecified(), inputs = unspecified(), detail = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - inputs = clean_value(inputs, "TYPE_MESSAGE", "substrait.Rel", repeated = TRUE), - detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), - .qualified_name = "substrait.ExtensionMultiRel" - ) - } - ), - ExtensionSingleRel = list( - create = function(..., common = unspecified(), input = unspecified(), detail = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), - .qualified_name = "substrait.ExtensionSingleRel" - ) - } - ), - FetchRel = list( - create = function(..., common = unspecified(), input = unspecified(), offset = unspecified(), count = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - offset = clean_value(offset, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), - count = clean_value(count, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.FetchRel" - ) - } - ), - FilterRel = list( - create = function(..., common = unspecified(), input = unspecified(), condition = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - condition = clean_value(condition, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.FilterRel" - ) - } - ), - JoinRel = list( - JoinType = list( - JOIN_TYPE_UNSPECIFIED = structure(0L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - JOIN_TYPE_INNER = structure(1L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - JOIN_TYPE_OUTER = structure(2L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - JOIN_TYPE_LEFT = structure(3L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - JOIN_TYPE_RIGHT = structure(4L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - JOIN_TYPE_SEMI = structure(5L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - JOIN_TYPE_ANTI = structure(6L, class = c("substrait_JoinRel_JoinType", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.JoinRel.JoinType" + NullableInteger = list( + create = function(..., value = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + value = clean_value(value, "TYPE_INT64", "TYPE_INT64", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.NullableInteger" ) } ), - create = function(..., common = unspecified(), left = unspecified(), right = unspecified(), expression = unspecified(), post_join_filter = unspecified(), type = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - left = clean_value(left, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - right = clean_value(right, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - expression = clean_value(expression, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), - post_join_filter = clean_value(post_join_filter, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), - type = clean_value(type, "TYPE_ENUM", "substrait.JoinRel.JoinType", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.JoinRel" - ) - } - ), - ProjectRel = list( - create = function(..., common = unspecified(), input = unspecified(), expressions = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - expressions = clean_value(expressions, "TYPE_MESSAGE", "substrait.Expression", repeated = TRUE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.ProjectRel" - ) - } - ), - ReadRel = list( - ExtensionTable = list( - create = function(..., detail = unspecified()) { + ParameterizedDecimal = list( + create = function(..., scale = unspecified(), precision = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + scale = clean_value(scale, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), + precision = clean_value(precision, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedDecimal" + ) + } + ), + ParameterizedFixedBinary = list( + create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + length = clean_value(length, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedFixedBinary" + ) + } + ), + ParameterizedFixedChar = list( + create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() create_substrait_message( - detail = clean_value(detail, "TYPE_MESSAGE", "substrait.Any", repeated = FALSE), - .qualified_name = "substrait.ReadRel.ExtensionTable" + length = clean_value(length, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedFixedChar" ) } ), - LocalFiles = list( - FileOrFiles = list( - FileFormat = list( - FILE_FORMAT_UNSPECIFIED = structure(0L, class = c("substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat", "substrait_proto_enum", "substrait_proto")), - FILE_FORMAT_PARQUET = structure(1L, class = c("substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.ReadRel.LocalFiles.FileOrFiles.FileFormat" - ) - } - ), - create = function(..., uri_path = unspecified(), uri_path_glob = unspecified(), uri_file = unspecified(), uri_folder = unspecified(), format = unspecified(), partition_index = unspecified(), start = unspecified(), length = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - uri_path = clean_value(uri_path, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - uri_path_glob = clean_value(uri_path_glob, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - uri_file = clean_value(uri_file, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - uri_folder = clean_value(uri_folder, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), - format = clean_value(format, "TYPE_ENUM", "substrait.ReadRel.LocalFiles.FileOrFiles.FileFormat", repeated = FALSE), - partition_index = clean_value(partition_index, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), - start = clean_value(start, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), - length = clean_value(length, "TYPE_UINT64", "TYPE_UINT64", repeated = FALSE), - .qualified_name = "substrait.ReadRel.LocalFiles.FileOrFiles" - ) - } - ), - create = function(..., items = unspecified(), advanced_extension = unspecified()) { + ParameterizedList = list( + create = function(..., type = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() create_substrait_message( - items = clean_value(items, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles.FileOrFiles", repeated = TRUE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.ReadRel.LocalFiles" + type = clean_value(type, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedList" ) } ), - NamedTable = list( - create = function(..., names = unspecified(), advanced_extension = unspecified()) { + ParameterizedMap = list( + create = function(..., key = unspecified(), value = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + key = clean_value(key, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), + value = clean_value(value, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedMap" + ) + } + ), + ParameterizedNamedStruct = list( + create = function(..., names = unspecified(), struct_ = unspecified()) { rlang::check_dots_empty() create_substrait_message( names = clean_value(names, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.ReadRel.NamedTable" + struct_ = clean_value(struct_, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedStruct", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedNamedStruct" ) } ), - VirtualTable = list( - create = function(..., values = unspecified()) { + ParameterizedStruct = list( + create = function(..., types = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() create_substrait_message( - values = clean_value(values, "TYPE_MESSAGE", "substrait.Expression.Literal.Struct", repeated = TRUE), - .qualified_name = "substrait.ReadRel.VirtualTable" + types = clean_value(types, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = TRUE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedStruct" ) } ), - create = function(..., common = unspecified(), base_schema = unspecified(), filter = unspecified(), projection = unspecified(), advanced_extension = unspecified(), virtual_table = unspecified(), local_files = unspecified(), named_table = unspecified(), extension_table = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - base_schema = clean_value(base_schema, "TYPE_MESSAGE", "substrait.NamedStruct", repeated = FALSE), - filter = clean_value(filter, "TYPE_MESSAGE", "substrait.Expression", repeated = FALSE), - projection = clean_value(projection, "TYPE_MESSAGE", "substrait.Expression.MaskExpression", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - virtual_table = clean_value(virtual_table, "TYPE_MESSAGE", "substrait.ReadRel.VirtualTable", repeated = FALSE), - local_files = clean_value(local_files, "TYPE_MESSAGE", "substrait.ReadRel.LocalFiles", repeated = FALSE), - named_table = clean_value(named_table, "TYPE_MESSAGE", "substrait.ReadRel.NamedTable", repeated = FALSE), - extension_table = clean_value(extension_table, "TYPE_MESSAGE", "substrait.ReadRel.ExtensionTable", repeated = FALSE), - .qualified_name = "substrait.ReadRel" - ) - } - ), - Rel = list( - create = function(..., read = unspecified(), filter = unspecified(), fetch = unspecified(), aggregate = unspecified(), sort = unspecified(), join = unspecified(), project = unspecified(), set = unspecified(), extension_single = unspecified(), extension_multi = unspecified(), extension_leaf = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - read = clean_value(read, "TYPE_MESSAGE", "substrait.ReadRel", repeated = FALSE), - filter = clean_value(filter, "TYPE_MESSAGE", "substrait.FilterRel", repeated = FALSE), - fetch = clean_value(fetch, "TYPE_MESSAGE", "substrait.FetchRel", repeated = FALSE), - aggregate = clean_value(aggregate, "TYPE_MESSAGE", "substrait.AggregateRel", repeated = FALSE), - sort = clean_value(sort, "TYPE_MESSAGE", "substrait.SortRel", repeated = FALSE), - join = clean_value(join, "TYPE_MESSAGE", "substrait.JoinRel", repeated = FALSE), - project = clean_value(project, "TYPE_MESSAGE", "substrait.ProjectRel", repeated = FALSE), - set = clean_value(set, "TYPE_MESSAGE", "substrait.SetRel", repeated = FALSE), - extension_single = clean_value(extension_single, "TYPE_MESSAGE", "substrait.ExtensionSingleRel", repeated = FALSE), - extension_multi = clean_value(extension_multi, "TYPE_MESSAGE", "substrait.ExtensionMultiRel", repeated = FALSE), - extension_leaf = clean_value(extension_leaf, "TYPE_MESSAGE", "substrait.ExtensionLeafRel", repeated = FALSE), - .qualified_name = "substrait.Rel" - ) - } - ), - RelCommon = list( - Direct = list( - create = function(...) { + ParameterizedUserDefined = list( + create = function(..., type_pointer = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() - create_substrait_message(.qualified_name = "substrait.RelCommon.Direct") + create_substrait_message( + type_pointer = clean_value(type_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedUserDefined" + ) } ), - Emit = list( - create = function(..., output_mapping = unspecified()) { + ParameterizedVarChar = list( + create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() create_substrait_message( - output_mapping = clean_value(output_mapping, "TYPE_INT32", "TYPE_INT32", repeated = TRUE), - .qualified_name = "substrait.RelCommon.Emit" + length = clean_value(length, "TYPE_MESSAGE", "substrait.ParameterizedType.IntegerOption", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType.ParameterizedVarChar" ) } ), - Hint = list( - RuntimeConstraint = list( - create = function(..., advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.RelCommon.Hint.RuntimeConstraint" - ) - } - ), - Stats = list( - create = function(..., row_count = unspecified(), record_size = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - row_count = clean_value(row_count, "TYPE_DOUBLE", "TYPE_DOUBLE", repeated = FALSE), - record_size = clean_value(record_size, "TYPE_DOUBLE", "TYPE_DOUBLE", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.RelCommon.Hint.Stats" - ) - } - ), - create = function(..., stats = unspecified(), constraint = unspecified(), advanced_extension = unspecified()) { + TypeParameter = list( + create = function(..., name = unspecified(), bounds = unspecified()) { rlang::check_dots_empty() create_substrait_message( - stats = clean_value(stats, "TYPE_MESSAGE", "substrait.RelCommon.Hint.Stats", repeated = FALSE), - constraint = clean_value(constraint, "TYPE_MESSAGE", "substrait.RelCommon.Hint.RuntimeConstraint", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.RelCommon.Hint" + name = clean_value(name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), + bounds = clean_value(bounds, "TYPE_MESSAGE", "substrait.ParameterizedType", repeated = TRUE), + .qualified_name = "substrait.ParameterizedType.TypeParameter" ) } ), - create = function(..., direct = unspecified(), emit = unspecified(), hint = unspecified(), advanced_extension = unspecified()) { - rlang::check_dots_empty() - create_substrait_message( - direct = clean_value(direct, "TYPE_MESSAGE", "substrait.RelCommon.Direct", repeated = FALSE), - emit = clean_value(emit, "TYPE_MESSAGE", "substrait.RelCommon.Emit", repeated = FALSE), - hint = clean_value(hint, "TYPE_MESSAGE", "substrait.RelCommon.Hint", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.RelCommon" - ) - } - ), - RelRoot = list( - create = function(..., input = unspecified(), names = unspecified()) { + create = function(..., bool_ = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year = unspecified(), interval_day = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), fixed_char = unspecified(), varchar = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), list = unspecified(), map = unspecified(), user_defined = unspecified(), user_defined_pointer = unspecified(), type_parameter = unspecified()) { rlang::check_dots_empty() create_substrait_message( - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - names = clean_value(names, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), - .qualified_name = "substrait.RelRoot" + bool_ = clean_value(bool_, "TYPE_MESSAGE", "substrait.Type.Boolean", repeated = FALSE), + i8 = clean_value(i8, "TYPE_MESSAGE", "substrait.Type.I8", repeated = FALSE), + i16 = clean_value(i16, "TYPE_MESSAGE", "substrait.Type.I16", repeated = FALSE), + i32 = clean_value(i32, "TYPE_MESSAGE", "substrait.Type.I32", repeated = FALSE), + i64 = clean_value(i64, "TYPE_MESSAGE", "substrait.Type.I64", repeated = FALSE), + fp32 = clean_value(fp32, "TYPE_MESSAGE", "substrait.Type.FP32", repeated = FALSE), + fp64 = clean_value(fp64, "TYPE_MESSAGE", "substrait.Type.FP64", repeated = FALSE), + string = clean_value(string, "TYPE_MESSAGE", "substrait.Type.String", repeated = FALSE), + binary = clean_value(binary, "TYPE_MESSAGE", "substrait.Type.Binary", repeated = FALSE), + timestamp = clean_value(timestamp, "TYPE_MESSAGE", "substrait.Type.Timestamp", repeated = FALSE), + date = clean_value(date, "TYPE_MESSAGE", "substrait.Type.Date", repeated = FALSE), + time = clean_value(time, "TYPE_MESSAGE", "substrait.Type.Time", repeated = FALSE), + interval_year = clean_value(interval_year, "TYPE_MESSAGE", "substrait.Type.IntervalYear", repeated = FALSE), + interval_day = clean_value(interval_day, "TYPE_MESSAGE", "substrait.Type.IntervalDay", repeated = FALSE), + timestamp_tz = clean_value(timestamp_tz, "TYPE_MESSAGE", "substrait.Type.TimestampTZ", repeated = FALSE), + uuid = clean_value(uuid, "TYPE_MESSAGE", "substrait.Type.UUID", repeated = FALSE), + fixed_char = clean_value(fixed_char, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedFixedChar", repeated = FALSE), + varchar = clean_value(varchar, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedVarChar", repeated = FALSE), + fixed_binary = clean_value(fixed_binary, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedFixedBinary", repeated = FALSE), + decimal = clean_value(decimal, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedDecimal", repeated = FALSE), + struct_ = clean_value(struct_, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedStruct", repeated = FALSE), + list = clean_value(list, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedList", repeated = FALSE), + map = clean_value(map, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedMap", repeated = FALSE), + user_defined = clean_value(user_defined, "TYPE_MESSAGE", "substrait.ParameterizedType.ParameterizedUserDefined", repeated = FALSE), + user_defined_pointer = clean_value(user_defined_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + type_parameter = clean_value(type_parameter, "TYPE_MESSAGE", "substrait.ParameterizedType.TypeParameter", repeated = FALSE), + .qualified_name = "substrait.ParameterizedType" ) } ), - SetRel = list( - SetOp = list( - SET_OP_UNSPECIFIED = structure(0L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - SET_OP_MINUS_PRIMARY = structure(1L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - SET_OP_MINUS_MULTISET = structure(2L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - SET_OP_INTERSECTION_PRIMARY = structure(3L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - SET_OP_INTERSECTION_MULTISET = structure(4L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - SET_OP_UNION_DISTINCT = structure(5L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - SET_OP_UNION_ALL = structure(6L, class = c("substrait_SetRel_SetOp", "substrait_proto_enum", "substrait_proto")), - create = function(value) { - create_substrait_enum( - value, - .qualified_name = "substrait.SetRel.SetOp" - ) - } - ), - create = function(..., common = unspecified(), inputs = unspecified(), op = unspecified(), advanced_extension = unspecified()) { + Plan = list( + create = function(..., extension_uris = unspecified(), extensions = unspecified(), relations = unspecified(), advanced_extensions = unspecified(), expected_type_urls = unspecified()) { rlang::check_dots_empty() create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - inputs = clean_value(inputs, "TYPE_MESSAGE", "substrait.Rel", repeated = TRUE), - op = clean_value(op, "TYPE_ENUM", "substrait.SetRel.SetOp", repeated = FALSE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.SetRel" + extension_uris = clean_value(extension_uris, "TYPE_MESSAGE", "substrait.extensions.SimpleExtensionURI", repeated = TRUE), + extensions = clean_value(extensions, "TYPE_MESSAGE", "substrait.extensions.SimpleExtensionDeclaration", repeated = TRUE), + relations = clean_value(relations, "TYPE_MESSAGE", "substrait.PlanRel", repeated = TRUE), + advanced_extensions = clean_value(advanced_extensions, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), + expected_type_urls = clean_value(expected_type_urls, "TYPE_STRING", "TYPE_STRING", repeated = TRUE), + .qualified_name = "substrait.Plan" ) } ), - SortRel = list( - create = function(..., common = unspecified(), input = unspecified(), sorts = unspecified(), advanced_extension = unspecified()) { + PlanRel = list( + create = function(..., rel = unspecified(), root = unspecified()) { rlang::check_dots_empty() create_substrait_message( - common = clean_value(common, "TYPE_MESSAGE", "substrait.RelCommon", repeated = FALSE), - input = clean_value(input, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), - sorts = clean_value(sorts, "TYPE_MESSAGE", "substrait.SortField", repeated = TRUE), - advanced_extension = clean_value(advanced_extension, "TYPE_MESSAGE", "substrait.extensions.AdvancedExtension", repeated = FALSE), - .qualified_name = "substrait.SortRel" + rel = clean_value(rel, "TYPE_MESSAGE", "substrait.Rel", repeated = FALSE), + root = clean_value(root, "TYPE_MESSAGE", "substrait.RelRoot", repeated = FALSE), + .qualified_name = "substrait.PlanRel" ) } ), @@ -1389,6 +1667,17 @@ substrait <- list( ) } ), + ExpressionUserDefined = list( + create = function(..., type_pointer = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + type_pointer = clean_value(type_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + variation_pointer = clean_value(variation_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.DerivationExpression.ExpressionUserDefined" + ) + } + ), ExpressionVarChar = list( create = function(..., length = unspecified(), variation_pointer = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() @@ -1451,7 +1740,7 @@ substrait <- list( ) } ), - create = function(..., bool_ = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year = unspecified(), interval_day = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), fixed_char = unspecified(), varchar = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), list = unspecified(), map = unspecified(), user_defined_pointer = unspecified(), type_parameter_name = unspecified(), integer_parameter_name = unspecified(), integer_literal = unspecified(), unary_op = unspecified(), binary_op = unspecified(), if_else = unspecified(), return_program = unspecified()) { + create = function(..., bool_ = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year = unspecified(), interval_day = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), fixed_char = unspecified(), varchar = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), list = unspecified(), map = unspecified(), user_defined = unspecified(), user_defined_pointer = unspecified(), type_parameter_name = unspecified(), integer_parameter_name = unspecified(), integer_literal = unspecified(), unary_op = unspecified(), binary_op = unspecified(), if_else_ = unspecified(), return_program = unspecified()) { rlang::check_dots_empty() create_substrait_message( bool_ = clean_value(bool_, "TYPE_MESSAGE", "substrait.Type.Boolean", repeated = FALSE), @@ -1477,13 +1766,14 @@ substrait <- list( struct_ = clean_value(struct_, "TYPE_MESSAGE", "substrait.DerivationExpression.ExpressionStruct", repeated = FALSE), list = clean_value(list, "TYPE_MESSAGE", "substrait.DerivationExpression.ExpressionList", repeated = FALSE), map = clean_value(map, "TYPE_MESSAGE", "substrait.DerivationExpression.ExpressionMap", repeated = FALSE), + user_defined = clean_value(user_defined, "TYPE_MESSAGE", "substrait.DerivationExpression.ExpressionUserDefined", repeated = FALSE), user_defined_pointer = clean_value(user_defined_pointer, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), type_parameter_name = clean_value(type_parameter_name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), integer_parameter_name = clean_value(integer_parameter_name, "TYPE_STRING", "TYPE_STRING", repeated = FALSE), integer_literal = clean_value(integer_literal, "TYPE_INT32", "TYPE_INT32", repeated = FALSE), unary_op = clean_value(unary_op, "TYPE_MESSAGE", "substrait.DerivationExpression.UnaryOp", repeated = FALSE), binary_op = clean_value(binary_op, "TYPE_MESSAGE", "substrait.DerivationExpression.BinaryOp", repeated = FALSE), - if_else = clean_value(if_else, "TYPE_MESSAGE", "substrait.DerivationExpression.IfElse", repeated = FALSE), + if_else_ = clean_value(if_else_, "TYPE_MESSAGE", "substrait.DerivationExpression.IfElse", repeated = FALSE), return_program = clean_value(return_program, "TYPE_MESSAGE", "substrait.DerivationExpression.ReturnProgram", repeated = FALSE), .qualified_name = "substrait.DerivationExpression" ) @@ -1739,6 +2029,17 @@ substrait <- list( ) } ), + UserDefined = list( + create = function(..., type_reference = unspecified(), type_variation_reference = unspecified(), nullability = unspecified()) { + rlang::check_dots_empty() + create_substrait_message( + type_reference = clean_value(type_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + type_variation_reference = clean_value(type_variation_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), + nullability = clean_value(nullability, "TYPE_ENUM", "substrait.Type.Nullability", repeated = FALSE), + .qualified_name = "substrait.Type.UserDefined" + ) + } + ), VarChar = list( create = function(..., length = unspecified(), type_variation_reference = unspecified(), nullability = unspecified()) { rlang::check_dots_empty() @@ -1750,7 +2051,7 @@ substrait <- list( ) } ), - create = function(..., bool_ = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year = unspecified(), interval_day = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), fixed_char = unspecified(), varchar = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), list = unspecified(), map = unspecified(), user_defined_type_reference = unspecified()) { + create = function(..., bool_ = unspecified(), i8 = unspecified(), i16 = unspecified(), i32 = unspecified(), i64 = unspecified(), fp32 = unspecified(), fp64 = unspecified(), string = unspecified(), binary = unspecified(), timestamp = unspecified(), date = unspecified(), time = unspecified(), interval_year = unspecified(), interval_day = unspecified(), timestamp_tz = unspecified(), uuid = unspecified(), fixed_char = unspecified(), varchar = unspecified(), fixed_binary = unspecified(), decimal = unspecified(), struct_ = unspecified(), list = unspecified(), map = unspecified(), user_defined = unspecified(), user_defined_type_reference = unspecified()) { rlang::check_dots_empty() create_substrait_message( bool_ = clean_value(bool_, "TYPE_MESSAGE", "substrait.Type.Boolean", repeated = FALSE), @@ -1776,6 +2077,7 @@ substrait <- list( struct_ = clean_value(struct_, "TYPE_MESSAGE", "substrait.Type.Struct", repeated = FALSE), list = clean_value(list, "TYPE_MESSAGE", "substrait.Type.List", repeated = FALSE), map = clean_value(map, "TYPE_MESSAGE", "substrait.Type.Map", repeated = FALSE), + user_defined = clean_value(user_defined, "TYPE_MESSAGE", "substrait.Type.UserDefined", repeated = FALSE), user_defined_type_reference = clean_value(user_defined_type_reference, "TYPE_UINT32", "TYPE_UINT32", repeated = FALSE), .qualified_name = "substrait.Type" ) diff --git a/R/util.R b/R/util.R index a7fa6ee2..f797c014 100644 --- a/R/util.R +++ b/R/util.R @@ -4,13 +4,14 @@ compare_dplyr_binding <- function(expr, tbl, engine = c("arrow", "duckdb"), ...) expected <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input = tbl))) if ("arrow" %in% engine) { - out_substrait <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input = arrow_substrait_compiler(tbl)))) - expect_identical(out_substrait, expected, ...) + warning("Skipping Arrow evluation until https://github.com/apache/arrow/pull/13914 merges") + # out_substrait <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input = arrow_substrait_compiler(tbl)))) + # expect_identical(out_substrait, expected, ...) } if ("duckdb" %in% engine) { out_duckdb <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input = duckdb_substrait_compiler(tbl)))) - expect_identical(out_duckdb, expected, ...) + testthat::expect_identical(out_duckdb, expected, ...) } } @@ -47,10 +48,10 @@ compare_dplyr_error <- function(expr, tbl, engine = c("arrow", "duckdb"), ...) { # make sure msg is a character object (i.e. there has been an error) # If it did not error, we would get a data.frame or whatever # This expectation will tell us "dplyr on data.frame errored is not TRUE" - expect_true(identical(typeof(msg), "character"), label = "dplyr on data.frame errored") + testthat::expect_true(identical(typeof(msg), "character"), label = "dplyr on data.frame errored") if ("arrow" %in% engine) { - expect_error( + testthat::expect_error( rlang::eval_tidy( expr, rlang::new_data_mask(rlang::env(.input = arrow_substrait_compiler(tbl))) @@ -61,7 +62,7 @@ compare_dplyr_error <- function(expr, tbl, engine = c("arrow", "duckdb"), ...) { } if ("duckdb" %in% engine) { - expect_error( + testthat::expect_error( rlang::eval_tidy( expr, rlang::new_data_mask(rlang::env(.input = duckdb_substrait_compiler(tbl))) @@ -93,7 +94,7 @@ with_language <- function(lang, expr) { Sys.setenv(LANGUAGE = old) }) if (!identical(before, i18ize_error_messages())) { - skip(paste("This OS either does not support changing languages to", lang, "or it caches translations")) + testthat::skip(paste("This OS either does not support changing languages to", lang, "or it caches translations")) } force(expr) } diff --git a/_pkgdown.yml b/_pkgdown.yml index b65ca884..0ec7fbde 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -12,7 +12,7 @@ reference: desc: Functions used to create substrait relations contents: - substrait_sort - - substrait_project + - substrait_select - substrait_filter - substrait_aggregate diff --git a/data-raw/example_data.R b/data-raw/example_data.R new file mode 100644 index 00000000..25613586 --- /dev/null +++ b/data-raw/example_data.R @@ -0,0 +1,37 @@ + +example_data <- tibble::tibble( + int = c(-3212L, 2L, 3L, NA_integer_, 5L, 6L, 7L, 8L, 9L, 3212L), + dbl = c(-999, -99, -9, 0, 9, pi, 99, 10000, 10000, NA_real_), + dbl2 = c(-Inf, 5, 5, 5, 5, 5, 5, 5, 5, 5), + lgl = c(NA, TRUE, NA, TRUE, FALSE, FALSE, NA, TRUE, FALSE, TRUE), + false = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), + chr = c("a", "b", "c", "d", "e", NA, "g", "h", "i", "j"), + verses = c( + "Por cada muro, un lamento", "En Jerusalén la dorada", + "Y mil vidas malgastadas", "Por cada mandamiento", "Yo soy polvo de tu viento", + "Y aunque sangro de tu herida", "Y cada piedra querida", + "Guarda mi amor más profundo", "No hay una piedra en el mundo", + "Que valga lo que una vida" + ), + padded_strings = c( + " a ", " b ", + " c ", " d ", " e ", " f ", " g ", + " h ", " i ", " j " + ), + some_negative = c(-1, 2, -3, NA, -5, 6, -7, 8, -9, 10) # , + # https://github.com/voltrondata/substrait-r/issues/80 + # dttm = lubridate::ymd_hms(c( + # "0000-01-01 00:00:00", + # "1919-05-29 13:08:55", + # "1955-06-20 04:10:42", + # "1973-06-30 11:38:41", + # "1987-03-29 12:49:47", + # "1991-06-11 19:07:01", + # NA_character_, + # "2017-08-21 18:26:40", + # "2017-08-21 18:26:40", + # "9999-12-31 23:59:59" + # )) +) + +usethis::use_data(example_data, overwrite = TRUE) diff --git a/data-raw/update-substrait.R b/data-raw/update-substrait.R index 5a373c61..688610ef 100644 --- a/data-raw/update-substrait.R +++ b/data-raw/update-substrait.R @@ -1,13 +1,14 @@ curl::curl_download( - "https://github.com/substrait-io/substrait/archive/refs/heads/main.zip", + "https://github.com/substrait-io/substrait/archive/refs/tags/v0.6.0.zip", "data-raw/substrait.zip" ) unzip("data-raw/substrait.zip", exdir = "data-raw") -fs::dir_copy("data-raw/substrait-main", "inst") -fs::file_move("inst/substrait-main", "inst/substrait") +unlink("inst/substrait", recursive = TRUE) +fs::dir_copy("data-raw/substrait-0.6.0", "inst") +fs::file_move("inst/substrait-0.6.0", "inst/substrait") dotfiles <- list.files( "inst/substrait", "^\\.", @@ -20,13 +21,13 @@ unlink(dotfiles) unlink("inst/substrait/.github", recursive = TRUE) unlink("inst/substrait/site", recursive = TRUE) -unlink("data-raw/substrait-main", recursive = TRUE) +unlink("data-raw/substrait-0.6.0", recursive = TRUE) unlink("data-raw/substrait.zip") # vendor nanopb # https://jpa.kapsi.fi/nanopb/download/ curl::curl_download( - "https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.5-macosx-x86.tar.gz", + "https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-macosx-x86.tar.gz", "data-raw/nanopb.tar.gz" ) @@ -39,28 +40,70 @@ nanopb_files <- c( "pb.h" ) -fs::file_copy(file.path("data-raw/nanopb-0.4.5-macosx-x86", nanopb_files), "src") +unlink(list.files("src", "^pb", full.names = TRUE)) +fs::file_copy(file.path("data-raw/nanopb-0.4.6-macosx-x86", nanopb_files), "src") -# generate the protobuf files +# add the 'Any' and 'Empty' type +# Probably don't need this because it's built in to Google protobuf +# but I haven't figured out the right includes yet to make it work +# https://github.com/protocolbuffers/protobuf/tree/main/src/google/protobuf +readr::write_file(' +syntax = "proto3"; + +package substrait; + +message Any { + string type_url = 1; + bytes value = 2; +} + +message Empty {} + +', "inst/substrait/proto/substrait/any.proto") + +# modify references to the Any type and +# clean up reserved words that were used as field names and give them +# an underscore suffix (because nanopb doesn't do any escaping itself) proto_files <- list.files( "inst/substrait/proto", "\\.proto$", recursive = TRUE ) -# clean up previous files +for (f in file.path("inst/substrait/proto", proto_files)) { + readr::read_file(f) |> + stringr::str_replace_all(stringr::fixed("google.protobuf.Any"), "Any") |> + stringr::str_replace_all(stringr::fixed("google.protobuf.Empty"), "Any") |> + stringr::str_replace_all( + stringr::fixed("google/protobuf/any.proto"), + "substrait/any.proto" + ) |> + stringr::str_replace_all( + "(\\s+)(enum|struct|if|else|bool|function)(\\s*=\\s*[0-9]+;)", + "\\1\\2_\\3" + ) |> + readr::write_file(f) +} + +# clean up previous nano-pb generated files unlink(list.files("src", "\\.pb\\.c$", recursive = TRUE, full.names = TRUE)) unlink("src/substrait", recursive = TRUE) -# have to figure out the correct nanopb.options +# TODO(dd): figure out the correct nanopb.options # to resolve circular references...-s type:FT_POINTER # is the workaround but this in theory only needs to exist for -# a few fields +# message fields. The right way to do this is to configure +# a standalone nanopb substrait project that handles this +# and adds the correct options to the .proto files +# as documented. Currrently we just need the files to exist +# because we parse bits of them to get properties that +# RProtoBut doesn't let us access. +# https://github.com/metormote/nanopb/blob/master/docs/concepts.rst#compiling-proto-files-with-nanopb-options proto_files_flat <- paste(proto_files, collapse = " ") withr::with_dir("inst/substrait/proto", { system( glue::glue( - "../../../data-raw/nanopb-0.4.5-macosx-x86/generator-bin/nanopb_generator \\ + "../../../data-raw/nanopb-0.4.6-macosx-x86/generator-bin/nanopb_generator \\ -s type:FT_POINTER { proto_files_flat } \\ --output-dir=../../../src" ) diff --git a/inst/substrait/CHANGELOG.md b/inst/substrait/CHANGELOG.md new file mode 100644 index 00000000..0d21f4ee --- /dev/null +++ b/inst/substrait/CHANGELOG.md @@ -0,0 +1,84 @@ +Release Notes +--- + +## [0.6.0](https://github.com/substrait-io/substrait/compare/v0.5.0...v0.6.0) (2022-06-26) + + +### Features + +* add contains, starts_with and ends_with functions definitions ([#228](https://github.com/substrait-io/substrait/issues/228)) ([a5fa851](https://github.com/substrait-io/substrait/commit/a5fa85153ffbf7005b9039e06f502a9cc8a732f0)) + + +### Bug Fixes + +* fix binary serialization idl link ([#229](https://github.com/substrait-io/substrait/issues/229)) ([af0b452](https://github.com/substrait-io/substrait/commit/af0b45247692dc4bb8fbd25c7f8ec59ff49dbc36)) + +## [0.5.0](https://github.com/substrait-io/substrait/compare/v0.4.0...v0.5.0) (2022-06-12) + + +### ⚠ BREAKING CHANGES + +* The `substrait/ReadRel/LocalFiles/format` field is deprecated. This will cause a hard break in compatibility. Newer consumers will not be able to read older files. Older consumers will not be able to read newer files. One should now express format concepts using the file_format oneof field. + +Co-authored-by: Jacques Nadeau + +### Features + +* add aggregate function min/max support ([#219](https://github.com/substrait-io/substrait/issues/219)) ([48b6b12](https://github.com/substrait-io/substrait/commit/48b6b12ebf74c3cc38d4381b950e2caaeb4eef78)) +* add Arrow and Orc file formats ([#169](https://github.com/substrait-io/substrait/issues/169)) ([43be00a](https://github.com/substrait-io/substrait/commit/43be00a73abd90fe8f0cafef2b8da9b078d1f243)) +* support nullable and non-default variation user-defined types ([#217](https://github.com/substrait-io/substrait/issues/217)) ([5851b02](https://github.com/substrait-io/substrait/commit/5851b02d29aafe44cd804f4248b95b0593878c0a)) + +## [0.4.0](https://github.com/substrait-io/substrait/compare/v0.3.0...v0.4.0) (2022-06-05) + + +### ⚠ BREAKING CHANGES + +* there was an accidental inclusion of a binary `not` function with unspecified behavior. This function was removed. Use the unary `not` function to return the compliment of an input argument. + +### Bug Fixes + +* remove not function that expects two arguments ([#182](https://github.com/substrait-io/substrait/issues/182)) ([e06067c](https://github.com/substrait-io/substrait/commit/e06067c991ddc34b2720408ed7e1ca5152774a29)) + +## [0.3.0](https://github.com/substrait-io/substrait/compare/v0.2.0...v0.3.0) (2022-05-22) + + +### Features + +* support type function arguments in protobuf ([#161](https://github.com/substrait-io/substrait/issues/161)) ([df98816](https://github.com/substrait-io/substrait/commit/df988163a5afcebe8823b9e466c3e1923c3b9e79)) +* define APPROX_COUNT_DISTINCT in new yaml for approximate aggregate functions ([#204](https://github.com/substrait-io/substrait/issues/204)) ([8e206b9](https://github.com/substrait-io/substrait/commit/8e206b9594880886c513c8437663fac15e0dfe59)) +* literals for extension types ([#197](https://github.com/substrait-io/substrait/issues/197)) ([296c266](https://github.com/substrait-io/substrait/commit/296c2661de007a2d8f41d3fe242a1f4b6e60c9e1)) +* support fractional seconds for interval_day literals ([#199](https://github.com/substrait-io/substrait/issues/199)) ([129e52f](https://github.com/substrait-io/substrait/commit/129e52f2519db00d6cef35f3faa3bc9e1ff1e890)) + +## [0.2.0](https://github.com/substrait-io/substrait/compare/v0.1.2...v0.2.0) (2022-05-15) + + +### Features + +* add flag FailureBehavior in Cast expression ([#186](https://github.com/substrait-io/substrait/issues/186)) ([a3d3b2f](https://github.com/substrait-io/substrait/commit/a3d3b2f5ccc6e8375a950290eda09489c7fb30e7)) +* add invocation property to AggregateFunction message for specifying distinct vs all ([#191](https://github.com/substrait-io/substrait/issues/191)) ([373b33f](https://github.com/substrait-io/substrait/commit/373b33f62b1e8f026718bc3b55cbe267421a1abb)) + +### [0.1.2](https://github.com/substrait-io/substrait/compare/v0.1.1...v0.1.2) (2022-05-01) + + +### Bug Fixes + +* **docs:** use conventionalcommits to show breaking changes first ([#181](https://github.com/substrait-io/substrait/issues/181)) ([b7f2587](https://github.com/substrait-io/substrait/commit/b7f2587f492071bed2250eb6f04c0b8123e715e1)) + +## [0.1.1](https://github.com/substrait-io/substrait/compare/v0.1.0...v0.1.1) (2022-04-28) + + +### Bug Fixes + +* **ci:** cd into buf-configured proto directory ([#180](https://github.com/substrait-io/substrait/issues/180)) ([78c0781](https://github.com/substrait-io/substrait/commit/78c0781f72cae2f4445a708ae3ccf0c2c3eb9725)) + +# [0.1.0](https://github.com/substrait-io/substrait/compare/v0.0.0...v0.1.0) (2022-04-28) + + +### Bug Fixes + +* add missing switch expression ([#160](https://github.com/substrait-io/substrait/issues/160)) ([4db2a9f](https://github.com/substrait-io/substrait/commit/4db2a9fb7e7849c73adcd21d1b06fb7e8df73fae)) + + +### Features + +* add subquery representation ([#134](https://github.com/substrait-io/substrait/issues/134)) ([3670518](https://github.com/substrait-io/substrait/commit/3670518d37c53660d496860f81c761ccb0afbce0)) diff --git a/inst/substrait/CONTRIBUTING.md b/inst/substrait/CONTRIBUTING.md new file mode 100644 index 00000000..c83a0d17 --- /dev/null +++ b/inst/substrait/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing to Substrait + +Welcome! + +## Dependencies + +There's no formal set of dependencies for Substrait, but here are some that are useful to have: + +* [`buf`](https://docs.buf.build/installation) for easy generation of proto serialization/deserialization code +* [`protoc`](https://grpc.io/docs/protoc-installation/), used by `buf` and usable independent of `buf` +* A Python environment with [the website's `requirements.txt`](https://github.com/substrait-io/substrait/blob/main/site/requirements.txt) dependencies installed if you want to see changes to the website locally + +## Commit Conventions + +Substrait follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit message structure. + +Examples of commit messages can be seen [here](https://www.conventionalcommits.org/en/v1.0.0/#examples). diff --git a/inst/substrait/LICENSE b/inst/substrait/LICENSE index 1e3ab95c..67db8588 100644 --- a/inst/substrait/LICENSE +++ b/inst/substrait/LICENSE @@ -173,30 +173,3 @@ defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 - Dremio Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/inst/substrait/buf.gen.yaml b/inst/substrait/buf.gen.yaml index d413e58c..cc216a96 100644 --- a/inst/substrait/buf.gen.yaml +++ b/inst/substrait/buf.gen.yaml @@ -1,10 +1,14 @@ version: v1 plugins: - - name: cpp + - remote: buf.build/protocolbuffers/plugins/cpp:v3.20.0-1 out: gen/proto/cpp - - name: csharp + - remote: buf.build/protocolbuffers/plugins/csharp:v3.20.0-1 out: gen/proto/csharp - - name: java + - remote: buf.build/protocolbuffers/plugins/java:v3.20.0-1 out: gen/proto/java - - name: python + - remote: buf.build/protocolbuffers/plugins/python:v3.20.0-1 out: gen/proto/python + - remote: buf.build/protocolbuffers/plugins/go:v1.28.0-1 + out: gen/proto/go + opt: + - paths=source_relative diff --git a/inst/substrait/ci/commit_messages.sh b/inst/substrait/ci/commit_messages.sh new file mode 100644 index 00000000..928a715b --- /dev/null +++ b/inst/substrait/ci/commit_messages.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +url="${1}" +page=1 + +while true; do + json="$(curl -LsS "${url}?page=${page}")" + len="$(jq length <<< "$json")" + if [ "$len" -eq "0" ]; then + break + fi + ((++page)) + jq -rcM '.[].commit.message' <<< "$json" +done diff --git a/inst/substrait/ci/release/dry_run.sh b/inst/substrait/ci/release/dry_run.sh new file mode 100644 index 00000000..238c57b2 --- /dev/null +++ b/inst/substrait/ci/release/dry_run.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +curdir="$PWD" +worktree="$(mktemp -d)" +branch="$(basename "$worktree")" + +git worktree add "$worktree" + +function cleanup() { + cd "$curdir" || exit 1 + git worktree remove "$worktree" + git worktree prune + git branch -D "$branch" +} + +trap cleanup EXIT ERR + +cd "$worktree" || exit 1 + +export GITHUB_REF="$branch" + +npx --yes \ + -p semantic-release \ + -p "@semantic-release/commit-analyzer" \ + -p "@semantic-release/release-notes-generator" \ + -p "@semantic-release/changelog" \ + -p "@semantic-release/exec" \ + -p "@semantic-release/git" \ + -p "conventional-changelog-conventionalcommits" \ + semantic-release \ + --ci false \ + --dry-run \ + --preset conventionalcommits \ + --plugins \ + --analyze-commits "@semantic-release/commit-analyzer" \ + --generate-notes "@semantic-release/release-notes-generator" \ + --verify-conditions "@semantic-release/changelog,@semantic-release/exec,@semantic-release/git" \ + --prepare "@semantic-release/changelog,@semantic-release/exec" \ + --branches "$branch" \ + --repository-url "file://$PWD" diff --git a/inst/substrait/ci/release/prepare.sh b/inst/substrait/ci/release/prepare.sh new file mode 100644 index 00000000..952cc4cc --- /dev/null +++ b/inst/substrait/ci/release/prepare.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +# build artifacts +buf build +buf generate diff --git a/inst/substrait/ci/release/publish.sh b/inst/substrait/ci/release/publish.sh new file mode 100644 index 00000000..e39fb7aa --- /dev/null +++ b/inst/substrait/ci/release/publish.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +cd "$(git rev-parse --show-toplevel)"/proto || exit 1 + +buf push --tag "v${1}" --tag "$(git rev-parse HEAD)" diff --git a/inst/substrait/ci/release/run.sh b/inst/substrait/ci/release/run.sh new file mode 100644 index 00000000..438e00c7 --- /dev/null +++ b/inst/substrait/ci/release/run.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +npx --yes \ + -p semantic-release \ + -p "@semantic-release/commit-analyzer" \ + -p "@semantic-release/release-notes-generator" \ + -p "@semantic-release/changelog" \ + -p "@semantic-release/github" \ + -p "@semantic-release/exec" \ + -p "@semantic-release/git" \ + -p "conventional-changelog-conventionalcommits" \ + semantic-release --ci diff --git a/inst/substrait/ci/release/verify.sh b/inst/substrait/ci/release/verify.sh new file mode 100644 index 00000000..e743cd94 --- /dev/null +++ b/inst/substrait/ci/release/verify.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# shellcheck shell=bash + +set -euo pipefail + +buf lint diff --git a/inst/substrait/extensions/functions_aggregate_approx.yaml b/inst/substrait/extensions/functions_aggregate_approx.yaml new file mode 100644 index 00000000..92cbf631 --- /dev/null +++ b/inst/substrait/extensions/functions_aggregate_approx.yaml @@ -0,0 +1,17 @@ +%YAML 1.2 +--- +aggregate_functions: + - name: "approx_count_distinct" + description: >- + Calculates the approximate number of rows that contain distinct values of the expression argument using + HyperLogLog. This function provides an alternative to the COUNT (DISTINCT expression) function, which + returns the exact number of rows that contain distinct values of an expression. APPROX_COUNT_DISTINCT + processes large amounts of data significantly faster than COUNT, with negligible deviation from the exact + result. + impls: + - args: + - value: any + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: binary + return: i64 diff --git a/inst/substrait/extensions/functions_aggregate_generic.yaml b/inst/substrait/extensions/functions_aggregate_generic.yaml index 0611d7d0..99433510 100644 --- a/inst/substrait/extensions/functions_aggregate_generic.yaml +++ b/inst/substrait/extensions/functions_aggregate_generic.yaml @@ -12,3 +12,13 @@ aggregate_functions: decomposable: MANY intermediate: i64 return: i64 + - name: "count" + description: "Count a set of records (not field referenced)" + impls: + - args: + - options: [SILENT, SATURATE, ERROR] + required: false + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i64 + return: i64 diff --git a/inst/substrait/extensions/functions_arithmetic.yaml b/inst/substrait/extensions/functions_arithmetic.yaml index 007e2515..00d7f84d 100644 --- a/inst/substrait/extensions/functions_arithmetic.yaml +++ b/inst/substrait/extensions/functions_arithmetic.yaml @@ -22,7 +22,7 @@ scalar_functions: required: false - value: i32 - value: i32 - return: i8 + return: i32 - args: - options: [ SILENT, SATURATE, ERROR ] required: false @@ -62,7 +62,7 @@ scalar_functions: required: false - value: i32 - value: i32 - return: i8 + return: i32 - args: - options: [ SILENT, SATURATE, ERROR ] required: false @@ -102,7 +102,7 @@ scalar_functions: required: false - value: i32 - value: i32 - return: i8 + return: i32 - args: - options: [ SILENT, SATURATE, ERROR ] required: false @@ -136,7 +136,7 @@ scalar_functions: - args: - value: i32 - value: i32 - return: i8 + return: i32 - args: - value: i64 - value: i64 @@ -168,7 +168,7 @@ scalar_functions: - args: - value: i32 - value: i32 - return: i8 + return: i32 - args: - value: i64 - value: i64 @@ -276,3 +276,81 @@ aggregate_functions: decomposable: MANY intermediate: "STRUCT" return: fp64? + - name: "min" + description: Min a set of values. + impls: + - args: + - value: i8 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i8? + return: i8? + - args: + - value: i16 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i16? + return: i16? + - args: + - value: i32 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i32? + return: i32? + - args: + - value: i64 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i64? + return: i64? + - args: + - value: fp32 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: fp32? + return: fp32? + - args: + - value: fp64 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: fp64? + return: fp64? + - name: "max" + description: Max a set of values. + impls: + - args: + - value: i8 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i8? + return: i8? + - args: + - value: i16 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i16? + return: i16? + - args: + - value: i32 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i32? + return: i32? + - args: + - value: i64 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: i64? + return: i64? + - args: + - value: fp32 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: fp32? + return: fp32? + - args: + - value: fp64 + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: fp64? + return: fp64? diff --git a/inst/substrait/extensions/functions_arithmetic_decimal.yaml b/inst/substrait/extensions/functions_arithmetic_decimal.yaml index feda3402..6ec1189d 100644 --- a/inst/substrait/extensions/functions_arithmetic_decimal.yaml +++ b/inst/substrait/extensions/functions_arithmetic_decimal.yaml @@ -12,11 +12,12 @@ scalar_functions: - value: decimal return: |- init_scale = max(S1,S2) - init_prec = init_scale + max(P1 - S1, P2-S2) + 1 + init_prec = init_scale + max(P1 - S1, P2 - S2) + 1 min_scale = min(init_scale, 6) delta = init_prec - 38 - prec = min(init_prec,38) - scale = init_prec > 38 ? scale - init_prec + 38 : min_scale + prec = min(init_prec, 38) + scale_after_borrow = max(init_scale - delta, min_scale) + scale = init_prec > 38 ? scale_after_borrow : init_scale DECIMAL - name: "subtract" @@ -28,11 +29,12 @@ scalar_functions: - value: decimal return: |- init_scale = max(S1,S2) - init_prec = init_scale + max(P1 - S1, P2-S2) + 1 + init_prec = init_scale + max(P1 - S1, P2 - S2) + 1 min_scale = min(init_scale, 6) delta = init_prec - 38 - prec = min(init_prec,38) - scale = init_prec > 38 ? scale - init_prec + 38 : min_scale + prec = min(init_prec, 38) + scale_after_borrow = max(init_scale - delta, min_scale) + scale = init_prec > 38 ? scale_after_borrow : init_scale DECIMAL - name: "multiply" @@ -47,8 +49,9 @@ scalar_functions: init_prec = P1 + P2 + 1 min_scale = min(init_scale, 6) delta = init_prec - 38 - prec = min(init_prec,38) - scale = init_prec > 38 ? scale - init_prec + 38 : min_scale + prec = min(init_prec, 38) + scale_after_borrow = max(init_scale - delta, min_scale) + scale = init_prec > 38 ? scale_after_borrow : init_scale DECIMAL - name: "divide" @@ -63,8 +66,9 @@ scalar_functions: init_prec = P1 - S1 + P2 + init_scale min_scale = min(init_scale, 6) delta = init_prec - 38 - prec = min(init_prec,38) - scale = init_prec > 38 ? scale - init_prec + 38 : min_scale + prec = min(init_prec, 38) + scale_after_borrow = max(init_scale - delta, min_scale) + scale = init_prec > 38 ? scale_after_borrow : init_scale DECIMAL - name: "modulus" @@ -79,8 +83,9 @@ scalar_functions: init_prec = min(P1 - S1, P2 - S2) + init_scale min_scale = min(init_scale, 6) delta = init_prec - 38 - prec = min(init_prec,38) - scale = init_prec > 38 ? scale - init_prec + 38 : min_scale + prec = min(init_prec, 38) + scale_after_borrow = max(init_scale - delta, min_scale) + scale = init_prec > 38 ? scale_after_borrow : init_scale DECIMAL aggregate_functions: - name: "sum" @@ -105,3 +110,21 @@ aggregate_functions: decomposable: MANY intermediate: "STRUCT,i64>" return: "DECIMAL<38,S>" + - name: "min" + description: Min a set of values. + impls: + - args: + - value: "DECIMAL" + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: "DECIMAL?" + return: "DECIMAL?" + - name: "max" + description: Max a set of values. + impls: + - args: + - value: "DECIMAL" + nullability: DECLARED_OUTPUT + decomposable: MANY + intermediate: "DECIMAL?" + return: "DECIMAL?" diff --git a/inst/substrait/extensions/functions_boolean.yaml b/inst/substrait/extensions/functions_boolean.yaml index 191871ef..cd0629a0 100644 --- a/inst/substrait/extensions/functions_boolean.yaml +++ b/inst/substrait/extensions/functions_boolean.yaml @@ -1,21 +1,14 @@ %YAML 1.2 --- scalar_functions: - - - name: not - description: The boolean not of a provided value. - impls: - - args: - - value: boolean - - value: boolean - return: boolean - name: or description: The boolean or of two values using Kleene logic. impls: - args: - value: boolean - - value: boolean + variadic: + min: 2 return: boolean - name: and @@ -23,7 +16,8 @@ scalar_functions: impls: - args: - value: boolean - - value: boolean + variadic: + min: 2 return: boolean - name: xor @@ -33,3 +27,10 @@ scalar_functions: - value: boolean - value: boolean return: boolean + - + name: not + description: The not of a boolean value. + impls: + - args: + - value: boolean + return: boolean diff --git a/inst/substrait/extensions/functions_cast.yaml b/inst/substrait/extensions/functions_cast.yaml new file mode 100644 index 00000000..245d2794 --- /dev/null +++ b/inst/substrait/extensions/functions_cast.yaml @@ -0,0 +1,11 @@ +%YAML 1.2 +--- +scalar_functions: + - + name: cast + description: Cast one type to another. + impls: + - args: + - value: any1 + - type: output + return: output diff --git a/inst/substrait/extensions/functions_comparison.yaml b/inst/substrait/extensions/functions_comparison.yaml index 33ce358a..ab7d118d 100644 --- a/inst/substrait/extensions/functions_comparison.yaml +++ b/inst/substrait/extensions/functions_comparison.yaml @@ -8,7 +8,7 @@ scalar_functions: - args: - value: any1 - value: any1 - return: BOOLEAN? + return: BOOLEAN - name: "equal" description: Whether two values are equal (nulls are considered unequal). @@ -16,7 +16,7 @@ scalar_functions: - args: - value: any1 - value: any1 - return: BOOLEAN? + return: BOOLEAN - name: "is_not_distinct_from" description: Whether two values are equal (nulls are considered equal). @@ -24,6 +24,53 @@ scalar_functions: - args: - value: any1 - value: any1 - return: BOOLEAN? -# TODO: add lt, gt, lte, gte, compare + return: BOOLEAN + - + name: "lt" + description: Less than + impls: + - args: + - value: any1 + - value: any1 + return: BOOLEAN + - + name: "gt" + description: Greater than + impls: + - args: + - value: any1 + - value: any1 + return: BOOLEAN + - + name: "lte" + description: Less than or equal to + impls: + - args: + - value: any1 + - value: any1 + return: BOOLEAN + - + name: "gte" + description: Greater than or equal to + impls: + - args: + - value: any1 + - value: any1 + return: BOOLEAN + - + name: "is_null" + description: Whether a value is null. + impls: + - args: + - value: any1 + return: BOOLEAN + nullability: DECLARED_OUTPUT + - + name: "is_not_null" + description: Whether a value is not null. + impls: + - args: + - value: any1 + return: BOOLEAN + nullability: DECLARED_OUTPUT diff --git a/inst/substrait/extensions/functions_datetime.yaml b/inst/substrait/extensions/functions_datetime.yaml index 5d832c1d..656b6977 100644 --- a/inst/substrait/extensions/functions_datetime.yaml +++ b/inst/substrait/extensions/functions_datetime.yaml @@ -97,3 +97,99 @@ scalar_functions: - value: date - value: interval_day return: date + - + name: "lte" + description: less than or equal to + impls: + - args: + - value: timestamp + - value: timestamp + return: boolean + - args: + - value: timestamp_tz + - value: timestamp_tz + return: boolean + - args: + - value: date + - value: date + return: boolean + - args: + - value: interval_day + - value: interval_day + return: boolean + - args: + - value: interval_year + - value: interval_year + return: boolean + - + name: "lt" + description: less than + impls: + - args: + - value: timestamp + - value: timestamp + return: boolean + - args: + - value: timestamp_tz + - value: timestamp_tz + return: boolean + - args: + - value: date + - value: date + return: boolean + - args: + - value: interval_day + - value: interval_day + return: boolean + - args: + - value: interval_year + - value: interval_year + return: boolean + - + name: "gte" + description: less than or equal to + impls: + - args: + - value: timestamp + - value: timestamp + return: boolean + - args: + - value: timestamp_tz + - value: timestamp_tz + return: boolean + - args: + - value: date + - value: date + return: boolean + - args: + - value: interval_day + - value: interval_day + return: boolean + - args: + - value: interval_year + - value: interval_year + return: boolean + - + name: "gt" + description: less than + impls: + - args: + - value: timestamp + - value: timestamp + return: boolean + - args: + - value: timestamp_tz + - value: timestamp_tz + return: boolean + - args: + - value: date + - value: date + return: boolean + - args: + - value: interval_day + - value: interval_day + return: boolean + - args: + - value: interval_year + - value: interval_year + return: boolean diff --git a/inst/substrait/extensions/functions_string.yaml b/inst/substrait/extensions/functions_string.yaml index 89cfc843..66b38930 100644 --- a/inst/substrait/extensions/functions_string.yaml +++ b/inst/substrait/extensions/functions_string.yaml @@ -13,4 +13,153 @@ scalar_functions: - value: "string" - value: "string" return: "string" -# TODO: add like, concat, substring, string specific cross type equalities. + - + name: like + description: Are two strings like each other. + impls: + - args: + - value: "varchar" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "string" + return: "BOOLEAN" + - + name: substring + description: Extract a portion of a string from another string. + impls: + - args: + - value: "varchar" + - value: i32 + - value: i32 + return: "varchar" + - args: + - value: "string" + - value: i32 + - value: i32 + return: "string" + - args: + - value: "fixedchar" + - value: i32 + - value: i32 + return: "string" + - name: starts_with + description: Whether this string starts with another string. + impls: + - args: + - value: "varchar" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "varchar" + - value: "string" + return: "BOOLEAN" + - args: + - value: "varchar" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "string" + return: "BOOLEAN" + - args: + - value: "string" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "string" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "varchar" + return: "BOOLEAN" + - + name: ends_with + description: Whether this string ends with another string. + impls: + - args: + - value: "varchar" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "varchar" + - value: "string" + return: "BOOLEAN" + - args: + - value: "varchar" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "string" + return: "BOOLEAN" + - args: + - value: "string" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "string" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "varchar" + return: "BOOLEAN" + - + name: contains + description: Whether this string contains another string. + impls: + - args: + - value: "varchar" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "varchar" + - value: "string" + return: "BOOLEAN" + - args: + - value: "varchar" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "string" + return: "BOOLEAN" + - args: + - value: "string" + - value: "varchar" + return: "BOOLEAN" + - args: + - value: "string" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "fixedchar" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "string" + return: "BOOLEAN" + - args: + - value: "fixedchar" + - value: "varchar" + return: "BOOLEAN" diff --git a/inst/substrait/proto/buf.yaml b/inst/substrait/proto/buf.yaml index 8b9ee4f7..d346b377 100644 --- a/inst/substrait/proto/buf.yaml +++ b/inst/substrait/proto/buf.yaml @@ -1,5 +1,5 @@ version: v1 -name: buf.build/substrait-io/substrait +name: buf.build/substrait/substrait lint: use: - DEFAULT diff --git a/inst/substrait/proto/substrait/algebra.proto b/inst/substrait/proto/substrait/algebra.proto new file mode 100644 index 00000000..e873fa0a --- /dev/null +++ b/inst/substrait/proto/substrait/algebra.proto @@ -0,0 +1,893 @@ +// SPDX-License-Identifier: Apache-2.0 +syntax = "proto3"; + +package substrait; + +import "substrait/any.proto"; +import "substrait/extensions/extensions.proto"; +import "substrait/type.proto"; + +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; +option java_multiple_files = true; +option java_package = "io.substrait.proto"; + +// Common fields for all relational operators +message RelCommon { + oneof emit_kind { + // The underlying relation is output as is (no reordering or projection of columns) + Direct direct = 1; + // Allows to control for order and inclusion of fields + Emit emit = 2; + } + + Hint hint = 3; + substrait.extensions.AdvancedExtension advanced_extension = 4; + + // Direct indicates no change on presence and ordering of fields in the output + message Direct {} + + // Remap which fields are output and in which order + message Emit { + repeated int32 output_mapping = 1; + } + + // Changes to the operation that can influence efficiency/performance but + // should not impact correctness. + message Hint { + Stats stats = 1; + RuntimeConstraint constraint = 2; + substrait.extensions.AdvancedExtension advanced_extension = 10; + + // The statistics related to a hint (physical properties of records) + message Stats { + double row_count = 1; + double record_size = 2; + substrait.extensions.AdvancedExtension advanced_extension = 10; + } + + message RuntimeConstraint { + // TODO: nodes, cpu threads/%, memory, iops, etc. + + substrait.extensions.AdvancedExtension advanced_extension = 10; + } + } +} + +// The scan operator of base data (physical or virtual), including filtering and projection. +message ReadRel { + RelCommon common = 1; + NamedStruct base_schema = 2; + Expression filter = 3; + Expression.MaskExpression projection = 4; + substrait.extensions.AdvancedExtension advanced_extension = 10; + + // Definition of which type of scan operation is to be performed + oneof read_type { + VirtualTable virtual_table = 5; + LocalFiles local_files = 6; + NamedTable named_table = 7; + ExtensionTable extension_table = 8; + } + + // A base table. The list of string is used to represent namespacing (e.g., mydb.mytable). + // This assumes shared catalog between systems exchanging a message. + message NamedTable { + repeated string names = 1; + substrait.extensions.AdvancedExtension advanced_extension = 10; + } + + // A table composed of literals. + message VirtualTable { + repeated Expression.Literal.Struct values = 1; + } + + // A stub type that can be used to extend/introduce new table types outside + // the specification. + message ExtensionTable { + Any detail = 1; + } + + // Represents a list of files in input of a scan operation + message LocalFiles { + repeated FileOrFiles items = 1; + substrait.extensions.AdvancedExtension advanced_extension = 10; + + // Many files consist of indivisible chunks (e.g. parquet row groups + // or CSV rows). If a slice partially selects an indivisible chunk + // then the consumer should employ some rule to decide which slice to + // include the chunk in (e.g. include it in the slice that contains + // the midpoint of the chunk) + message FileOrFiles { + oneof path_type { + // A URI that can refer to either a single folder or a single file + string uri_path = 1; + // A URI where the path portion is a glob expression that can + // identify zero or more paths. + // Consumers should support the POSIX syntax. The recursive + // globstar (**) may not be supported. + string uri_path_glob = 2; + // A URI that refers to a single file + string uri_file = 3; + // A URI that refers to a single folder + string uri_folder = 4; + } + + // Original file format enum, superseded by the file_format oneof. + reserved 5; + reserved "format"; + + // The index of the partition this item belongs to + uint64 partition_index = 6; + + // The start position in byte to read from this item + uint64 start = 7; + + // The length in byte to read from this item + uint64 length = 8; + + message ParquetReadOptions {} + message ArrowReadOptions {} + message OrcReadOptions {} + + // The format of the files. + oneof file_format { + ParquetReadOptions parquet = 9; + ArrowReadOptions arrow = 10; + OrcReadOptions orc = 11; + Any extension = 12; + } + } + } +} + +// This operator allows to represent calculated expressions of fields (e.g., a+b). Direct/Emit are used to represent classical relational projections +message ProjectRel { + RelCommon common = 1; + Rel input = 2; + repeated Expression expressions = 3; + substrait.extensions.AdvancedExtension advanced_extension = 10; +} + +// The binary JOIN relational operator left-join-right, including various join types, a join condition and post_join_filter expression +message JoinRel { + RelCommon common = 1; + Rel left = 2; + Rel right = 3; + Expression expression = 4; + Expression post_join_filter = 5; + + JoinType type = 6; + + enum JoinType { + JOIN_TYPE_UNSPECIFIED = 0; + JOIN_TYPE_INNER = 1; + JOIN_TYPE_OUTER = 2; + JOIN_TYPE_LEFT = 3; + JOIN_TYPE_RIGHT = 4; + JOIN_TYPE_SEMI = 5; + JOIN_TYPE_ANTI = 6; + // This join is useful for nested sub-queries where we need exactly one tuple in output (or throw exception) + // See Section 3.2 of https://15721.courses.cs.cmu.edu/spring2018/papers/16-optimizer2/hyperjoins-btw2017.pdf + JOIN_TYPE_SINGLE = 7; + } + + substrait.extensions.AdvancedExtension advanced_extension = 10; +} + +// Cartesian product relational operator of two tables (left and right) +message CrossRel { + RelCommon common = 1; + Rel left = 2; + Rel right = 3; + + substrait.extensions.AdvancedExtension advanced_extension = 10; +} + +// The relational operator representing LIMIT/OFFSET or TOP type semantics. +message FetchRel { + RelCommon common = 1; + Rel input = 2; + // the offset expressed in number of records + int64 offset = 3; + // the amount of records to return + int64 count = 4; + substrait.extensions.AdvancedExtension advanced_extension = 10; +} + +// The relational operator representing a GROUP BY Aggregate +message AggregateRel { + RelCommon common = 1; + + // Input of the aggregation + Rel input = 2; + + // A list of expression grouping that the aggregation measured should be calculated for. + repeated Grouping groupings = 3; + + // A list of one or more aggregate expressions along with an optional filter. + repeated Measure measures = 4; + + substrait.extensions.AdvancedExtension advanced_extension = 10; + + message Grouping { + repeated Expression grouping_expressions = 1; + } + + message Measure { + AggregateFunction measure = 1; + + // An optional boolean expression that acts to filter which records are + // included in the measure. True means include this record for calculation + // within the measure. + // Helps to support SUM() FILTER(WHERE...) syntax without masking opportunities for optimization + Expression filter = 2; + } +} + +// The ORDERY BY (or sorting) relational operator. Beside describing a base relation, it includes a list of fields to sort on +message SortRel { + RelCommon common = 1; + Rel input = 2; + repeated SortField sorts = 3; + substrait.extensions.AdvancedExtension advanced_extension = 10; +} + +// The relational operator capturing simple FILTERs (as in the WHERE clause of SQL) +message FilterRel { + RelCommon common = 1; + Rel input = 2; + Expression condition = 3; + substrait.extensions.AdvancedExtension advanced_extension = 10; +} + +// The relational set operators (intersection/union/etc..) +message SetRel { + RelCommon common = 1; + repeated Rel inputs = 2; + SetOp op = 3; + substrait.extensions.AdvancedExtension advanced_extension = 10; + + enum SetOp { + SET_OP_UNSPECIFIED = 0; + SET_OP_MINUS_PRIMARY = 1; + SET_OP_MINUS_MULTISET = 2; + SET_OP_INTERSECTION_PRIMARY = 3; + SET_OP_INTERSECTION_MULTISET = 4; + SET_OP_UNION_DISTINCT = 5; + SET_OP_UNION_ALL = 6; + } +} + +// Stub to support extension with a single input +message ExtensionSingleRel { + RelCommon common = 1; + Rel input = 2; + Any detail = 3; +} + +// Stub to support extension with a zero inputs +message ExtensionLeafRel { + RelCommon common = 1; + Any detail = 2; +} + +// Stub to support extension with multiple inputs +message ExtensionMultiRel { + RelCommon common = 1; + repeated Rel inputs = 2; + Any detail = 3; +} + +// A redistribution operation +message ExchangeRel { + RelCommon common = 1; + Rel input = 2; + int32 partition_count = 3; + repeated ExchangeTarget targets = 4; + + // the type of exchange used + oneof exchange_kind { + ScatterFields scatter_by_fields = 5; + SingleBucketExpression single_target = 6; + MultiBucketExpression multi_target = 7; + RoundRobin round_robin = 8; + Broadcast broadcast = 9; + } + + substrait.extensions.AdvancedExtension advanced_extension = 10; + + message ScatterFields { + repeated Expression.FieldReference fields = 1; + } + + // Returns a single bucket number per record. + message SingleBucketExpression { + Expression expression = 1; + } + + // Returns zero or more bucket numbers per record + message MultiBucketExpression { + Expression expression = 1; + bool constrained_to_count = 2; + } + + // Send all data to every target. + message Broadcast {} + + // Route approximately + message RoundRobin { + // whether the round robin behavior is required to exact (per record) or + // approximate. Defaults to approximate. + bool exact = 1; + } + + // The message to describe partition targets of an exchange + message ExchangeTarget { + // Describes the partition id(s) to send. If this is empty, all data is sent + // to this target. + repeated int32 partition_id = 1; + + oneof target_type { + string uri = 2; + Any extended = 3; + } + } +} + +// A relation with output field names. +// +// This is for use at the root of a `Rel` tree. +message RelRoot { + // A relation + Rel input = 1; + // Field names in depth-first order + repeated string names = 2; +} + +// A relation (used internally in a plan) +message Rel { + oneof rel_type { + ReadRel read = 1; + FilterRel filter = 2; + FetchRel fetch = 3; + AggregateRel aggregate = 4; + SortRel sort = 5; + JoinRel join = 6; + ProjectRel project = 7; + SetRel set = 8; + ExtensionSingleRel extension_single = 9; + ExtensionMultiRel extension_multi = 10; + ExtensionLeafRel extension_leaf = 11; + CrossRel cross = 12; + } +} + +// The argument of a function +message FunctionArgument { + oneof arg_type { + Enum enum_ = 1; + Type type = 2; + Expression value = 3; + } + + message Enum { + oneof enum_kind { + string specified = 1; + Any unspecified = 2; + } + } +} + +message Expression { + oneof rex_type { + Literal literal = 1; + FieldReference selection = 2; + ScalarFunction scalar_function = 3; + WindowFunction window_function = 5; + IfThen if_then = 6; + SwitchExpression switch_expression = 7; + SingularOrList singular_or_list = 8; + MultiOrList multi_or_list = 9; + Cast cast = 11; + Subquery subquery = 12; + + // deprecated: enum literals are only sensible in the context of + // function arguments, for which FunctionArgument should now be + // used + Enum enum_ = 10 [deprecated = true]; + } + + message Enum { + option deprecated = true; + + oneof enum_kind { + string specified = 1; + Empty unspecified = 2; + } + + message Empty { + option deprecated = true; + } + } + + message Literal { + oneof literal_type { + bool boolean = 1; + int32 i8 = 2; + int32 i16 = 3; + int32 i32 = 5; + int64 i64 = 7; + float fp32 = 10; + double fp64 = 11; + string string = 12; + bytes binary = 13; + // Timestamp in units of microseconds since the UNIX epoch. + int64 timestamp = 14; + // Date in units of days since the UNIX epoch. + int32 date = 16; + // Time in units of microseconds past midnight + int64 time = 17; + IntervalYearToMonth interval_year_to_month = 19; + IntervalDayToSecond interval_day_to_second = 20; + string fixed_char = 21; + VarChar var_char = 22; + bytes fixed_binary = 23; + Decimal decimal = 24; + Struct struct_ = 25; + Map map = 26; + // Timestamp in units of microseconds since the UNIX epoch. + int64 timestamp_tz = 27; + bytes uuid = 28; + Type null = 29; // a typed null literal + List list = 30; + Type.List empty_list = 31; + Type.Map empty_map = 32; + UserDefined user_defined = 33; + } + + // whether the literal type should be treated as a nullable type. Applies to + // all members of union other than the Typed null (which should directly + // declare nullability). + bool nullable = 50; + + // optionally points to a type_variation_anchor defined in this plan. + // Applies to all members of union other than the Typed null (which should + // directly declare the type variation). + uint32 type_variation_reference = 51; + + message VarChar { + string value = 1; + uint32 length = 2; + } + + message Decimal { + // little-endian twos-complement integer representation of complete value + // (ignoring precision) Always 16 bytes in length + bytes value = 1; + // The maximum number of digits allowed in the value. + // the maximum precision is 38. + int32 precision = 2; + // declared scale of decimal literal + int32 scale = 3; + } + + message Map { + message KeyValue { + Literal key = 1; + Literal value = 2; + } + + repeated KeyValue key_values = 1; + } + + message IntervalYearToMonth { + int32 years = 1; + int32 months = 2; + } + + message IntervalDayToSecond { + int32 days = 1; + int32 seconds = 2; + int32 microseconds = 3; + } + + message Struct { + // A possibly heterogeneously typed list of literals + repeated Literal fields = 1; + } + + message List { + // A homogeneously typed list of literals + repeated Literal values = 1; + } + + message UserDefined { + // points to a type_anchor defined in this plan + uint32 type_reference = 1; + + // the value of the literal, serialized using some type-specific + // protobuf message + Any value = 2; + } + } + + message ScalarFunction { + // points to a function_anchor defined in this plan + uint32 function_reference = 1; + repeated FunctionArgument arguments = 4; + Type output_type = 3; + + // deprecated; use args instead + repeated Expression args = 2 [deprecated = true]; + } + + message WindowFunction { + // points to a function_anchor defined in this plan + uint32 function_reference = 1; + repeated Expression partitions = 2; + repeated SortField sorts = 3; + Bound upper_bound = 4; + Bound lower_bound = 5; + AggregationPhase phase = 6; + Type output_type = 7; + repeated FunctionArgument arguments = 9; + + // deprecated; use args instead + repeated Expression args = 8 [deprecated = true]; + + message Bound { + message Preceding { + int64 offset = 1; + } + + message Following { + int64 offset = 1; + } + + message CurrentRow {} + + message Unbounded {} + + oneof kind { + Preceding preceding = 1; + Following following = 2; + CurrentRow current_row = 3; + Unbounded unbounded = 4; + } + } + } + + message IfThen { + repeated IfClause ifs = 1; + Expression else_ = 2; + + message IfClause { + Expression if_ = 1; + Expression then = 2; + } + } + + message Cast { + Type type = 1; + Expression input = 2; + FailureBehavior failure_behavior = 3; + + enum FailureBehavior { + FAILURE_BEHAVIOR_UNSPECIFIED = 0; + FAILURE_BEHAVIOR_RETURN_NULL = 1; + FAILURE_BEHAVIOR_THROW_EXCEPTION = 2; + } + } + + message SwitchExpression { + Expression match = 3; + repeated IfValue ifs = 1; + Expression else_ = 2; + + message IfValue { + Literal if_ = 1; + Expression then = 2; + } + } + + message SingularOrList { + Expression value = 1; + repeated Expression options = 2; + } + + message MultiOrList { + repeated Expression value = 1; + repeated Record options = 2; + + message Record { + repeated Expression fields = 1; + } + } + + message EmbeddedFunction { + repeated Expression arguments = 1; + Type output_type = 2; + oneof kind { + PythonPickleFunction python_pickle_function = 3; + WebAssemblyFunction web_assembly_function = 4; + } + + message PythonPickleFunction { + bytes function_ = 1; + repeated string prerequisite = 2; + } + + message WebAssemblyFunction { + bytes script = 1; + repeated string prerequisite = 2; + } + } + + // A way to reference the inner property of a complex record. Can reference + // either a map key by literal, a struct field by the ordinal position of + // the desired field or a particular element in an array. Supports + // expressions that would roughly translate to something similar to: + // a.b[2].c['my_map_key'].x where a,b,c and x are struct field references + // (ordinalized in the internal representation here), [2] is a list offset + // and ['my_map_key'] is a reference into a map field. + message ReferenceSegment { + oneof reference_type { + MapKey map_key = 1; + StructField struct_field = 2; + ListElement list_element = 3; + } + + message MapKey { + // literal based reference to specific possible value in map. + Literal map_key = 1; + + // Optional child segment + ReferenceSegment child = 2; + } + + message StructField { + // zero-indexed ordinal position of field in struct + int32 field = 1; + + // Optional child segment + ReferenceSegment child = 2; + } + + message ListElement { + // zero-indexed ordinal position of element in list + int32 offset = 1; + + // Optional child segment + ReferenceSegment child = 2; + } + } + + // A reference that takes an existing subtype and selectively removes fields + // from it. For example, one might initially have an inner struct with 100 + // fields but a a particular operation only needs to interact with only 2 of + // those 100 fields. In this situation, one would use a mask expression to + // eliminate the 98 fields that are not relevant to the rest of the operation + // pipeline. + // + // Note that this does not fundamentally alter the structure of data beyond + // the elimination of unecessary elements. + message MaskExpression { + StructSelect select = 1; + bool maintain_singular_struct_ = 2; + + message Select { + oneof type { + StructSelect struct_ = 1; + ListSelect list = 2; + MapSelect map = 3; + } + } + + message StructSelect { + repeated StructItem struct_items = 1; + } + + message StructItem { + int32 field = 1; + Select child = 2; + } + + message ListSelect { + repeated ListSelectItem selection = 1; + Select child = 2; + + message ListSelectItem { + oneof type { + ListElement item = 1; + ListSlice slice = 2; + } + + message ListElement { + int32 field = 1; + } + + message ListSlice { + int32 start = 1; + int32 end = 2; + } + } + } + + message MapSelect { + oneof select { + MapKey key = 1; + MapKeyExpression expression = 2; + } + + Select child = 3; + + message MapKey { + string map_key = 1; + } + + message MapKeyExpression { + string map_key_expression = 1; + } + } + } + + // A reference to an inner part of a complex object. Can reference reference a + // single element or a masked version of elements + message FieldReference { + // Whether this is composed of a single element reference or a masked + // element subtree + oneof reference_type { + ReferenceSegment direct_reference = 1; + MaskExpression masked_reference = 2; + } + + // Whether this reference has an origin of a root struct or is based on the + // ouput of an expression. When this is a RootReference and direct_reference + // above is used, the direct_reference must be of a type StructField. + oneof root_type { + Expression expression = 3; + RootReference root_reference = 4; + OuterReference outer_reference = 5; + } + + // Singleton that expresses this FieldReference is rooted off the root + // incoming record type + message RootReference {} + + // A root reference for the outer relation's subquery + message OuterReference { + // number of subquery boundaries to traverse up for this field's reference + // + // This value must be >= 1 + uint32 steps_out = 1; + } + } + + // Subquery relation expression + message Subquery { + oneof subquery_type { + // Scalar subquery + Scalar scalar = 1; + // x IN y predicate + InPredicate in_predicate = 2; + // EXISTS/UNIQUE predicate + SetPredicate set_predicate = 3; + // ANY/ALL predicate + SetComparison set_comparison = 4; + } + + // A subquery with one row and one column. This is often an aggregate + // though not required to be. + message Scalar { + Rel input = 1; + } + + // Predicate checking that the left expression is contained in the right + // subquery + // + // Examples: + // + // x IN (SELECT * FROM t) + // (x, y) IN (SELECT a, b FROM t) + message InPredicate { + repeated Expression needles = 1; + Rel haystack = 2; + } + + // A predicate over a set of rows in the form of a subquery + // EXISTS and UNIQUE are common SQL forms of this operation. + message SetPredicate { + enum PredicateOp { + PREDICATE_OP_UNSPECIFIED = 0; + PREDICATE_OP_EXISTS = 1; + PREDICATE_OP_UNIQUE = 2; + } + // TODO: should allow expressions + PredicateOp predicate_op = 1; + Rel tuples = 2; + } + + // A subquery comparison using ANY or ALL. + // Examples: + // + // SELECT * + // FROM t1 + // WHERE x < ANY(SELECT y from t2) + message SetComparison { + enum ComparisonOp { + COMPARISON_OP_UNSPECIFIED = 0; + COMPARISON_OP_EQ = 1; + COMPARISON_OP_NE = 2; + COMPARISON_OP_LT = 3; + COMPARISON_OP_GT = 4; + COMPARISON_OP_LE = 5; + COMPARISON_OP_GE = 6; + } + + enum ReductionOp { + REDUCTION_OP_UNSPECIFIED = 0; + REDUCTION_OP_ANY = 1; + REDUCTION_OP_ALL = 2; + } + + // ANY or ALL + ReductionOp reduction_op = 1; + // A comparison operator + ComparisonOp comparison_op = 2; + // left side of the expression + Expression left = 3; + // right side of the expression + Rel right = 4; + } + } +} + +// The description of a field to sort on (including the direction of sorting and null semantics) +message SortField { + Expression expr = 1; + + oneof sort_kind { + SortDirection direction = 2; + uint32 comparison_function_reference = 3; + } + enum SortDirection { + SORT_DIRECTION_UNSPECIFIED = 0; + SORT_DIRECTION_ASC_NULLS_FIRST = 1; + SORT_DIRECTION_ASC_NULLS_LAST = 2; + SORT_DIRECTION_DESC_NULLS_FIRST = 3; + SORT_DIRECTION_DESC_NULLS_LAST = 4; + SORT_DIRECTION_CLUSTERED = 5; + } +} + +enum AggregationPhase { + AGGREGATION_PHASE_UNSPECIFIED = 0; + AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE = 1; + AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE = 2; + AGGREGATION_PHASE_INITIAL_TO_RESULT = 3; + AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT = 4; +} + +message AggregateFunction { + // points to a function_anchor defined in this plan + uint32 function_reference = 1; + repeated FunctionArgument arguments = 7; + repeated SortField sorts = 3; + AggregationPhase phase = 4; + Type output_type = 5; + AggregationInvocation invocation = 6; + + // deprecated; use args instead + repeated Expression args = 2 [deprecated = true]; + + enum AggregationInvocation { + AGGREGATION_INVOCATION_UNSPECIFIED = 0; + + // Use all values in aggregation calculation + AGGREGATION_INVOCATION_ALL = 1; + + // Use only distinct values in aggregation calculation + AGGREGATION_INVOCATION_DISTINCT = 2; + } +} diff --git a/inst/substrait/proto/substrait/any.proto b/inst/substrait/proto/substrait/any.proto index 3eadc8fb..482e6244 100644 --- a/inst/substrait/proto/substrait/any.proto +++ b/inst/substrait/proto/substrait/any.proto @@ -1,3 +1,4 @@ + syntax = "proto3"; package substrait; @@ -6,3 +7,6 @@ message Any { string type_url = 1; bytes value = 2; } + +message Empty {} + diff --git a/inst/substrait/proto/substrait/capabilities.proto b/inst/substrait/proto/substrait/capabilities.proto index 711f0ccb..35142718 100644 --- a/inst/substrait/proto/substrait/capabilities.proto +++ b/inst/substrait/proto/substrait/capabilities.proto @@ -1,14 +1,15 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package substrait; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; // Defines a set of Capabilities that a system (producer or consumer) supports. message Capabilities { - // List of Substrait versions this system supports repeated string substrait_versions = 1; diff --git a/inst/substrait/proto/substrait/expression.proto b/inst/substrait/proto/substrait/expression.proto deleted file mode 100644 index aa0582e0..00000000 --- a/inst/substrait/proto/substrait/expression.proto +++ /dev/null @@ -1,372 +0,0 @@ -syntax = "proto3"; - -package substrait; - -import "substrait/type.proto"; - -option java_multiple_files = true; -option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; - -message Expression { - oneof rex_type { - Literal literal = 1; - FieldReference selection = 2; - ScalarFunction scalar_function = 3; - WindowFunction window_function = 5; - IfThen if_then = 6; - SwitchExpression switch_expression = 7; - SingularOrList singular_or_list = 8; - MultiOrList multi_or_list = 9; - Enum enum_ = 10; - Cast cast = 11; - } - - message Enum { - oneof enum_kind { - string specified = 1; - Empty unspecified = 2; - } - - message Empty {} - } - - message Literal { - oneof literal_type { - bool boolean = 1; - int32 i8 = 2; - int32 i16 = 3; - int32 i32 = 5; - int64 i64 = 7; - float fp32 = 10; - double fp64 = 11; - string string = 12; - bytes binary = 13; - // Timestamp in units of microseconds since the UNIX epoch. - int64 timestamp = 14; - // Date in units of days since the UNIX epoch. - int32 date = 16; - // Time in units of microseconds past midnight - int64 time = 17; - IntervalYearToMonth interval_year_to_month = 19; - IntervalDayToSecond interval_day_to_second = 20; - string fixed_char = 21; - VarChar var_char = 22; - bytes fixed_binary = 23; - Decimal decimal = 24; - Struct struct_ = 25; - Map map = 26; - // Timestamp in units of microseconds since the UNIX epoch. - int64 timestamp_tz = 27; - bytes uuid = 28; - Type null = 29; // a typed null literal - List list = 30; - Type.List empty_list = 31; - Type.Map empty_map = 32; - } - - // whether the literal type should be treated as a nullable type. Applies to - // all members of union other than the Typed null (which should directly - // declare nullability). - bool nullable = 50; - - message VarChar { - string value = 1; - uint32 length = 2; - } - - message Decimal { - // little-endian twos-complement integer representation of complete value - // (ignoring precision) Always 16 bytes in length - bytes value = 1; - // The maximum number of digits allowed in the value. - // the maximum precision is 38. - int32 precision = 2; - // declared scale of decimal literal - int32 scale = 3; - } - - message Map { - message KeyValue { - Literal key = 1; - Literal value = 2; - } - - repeated KeyValue key_values = 1; - } - - message IntervalYearToMonth { - int32 years = 1; - int32 months = 2; - } - - message IntervalDayToSecond { - int32 days = 1; - int32 seconds = 2; - } - - message Struct { - // A possibly heterogeneously typed list of literals - repeated Literal fields = 1; - } - - message List { - // A homogeneously typed list of literals - repeated Literal values = 1; - } - } - - message ScalarFunction { - // points to a function_anchor defined in this plan - uint32 function_reference = 1; - repeated Expression args = 2; - Type output_type = 3; - } - - message WindowFunction { - // points to a function_anchor defined in this plan - uint32 function_reference = 1; - repeated Expression partitions = 2; - repeated SortField sorts = 3; - Bound upper_bound = 4; - Bound lower_bound = 5; - AggregationPhase phase = 6; - Type output_type = 7; - repeated Expression args = 8; - - message Bound { - - message Preceding { int64 offset = 1; } - - message Following { int64 offset = 1; } - - message CurrentRow {} - - message Unbounded {} - - oneof kind { - Preceding preceding = 1; - Following following = 2; - CurrentRow current_row = 3; - Unbounded unbounded = 4; - } - } - } - - message IfThen { - - repeated IfClause ifs = 1; - Expression else_ = 2; - - message IfClause { - Expression if_ = 1; - Expression then = 2; - } - } - - message Cast { - Type type = 1; - Expression input = 2; - } - - message SwitchExpression { - repeated IfValue ifs = 1; - Expression else_ = 2; - - message IfValue { - Literal if_ = 1; - Expression then = 2; - } - } - - message SingularOrList { - Expression value = 1; - repeated Expression options = 2; - } - - message MultiOrList { - repeated Expression value = 1; - repeated Record options = 2; - - message Record { repeated Expression fields = 1; } - } - - message EmbeddedFunction { - repeated Expression arguments = 1; - Type output_type = 2; - oneof kind { - PythonPickleFunction python_pickle_function = 3; - WebAssemblyFunction web_assembly_function = 4; - } - - message PythonPickleFunction { - bytes function_ = 1; - repeated string prerequisite = 2; - } - - message WebAssemblyFunction { - bytes script = 1; - repeated string prerequisite = 2; - } - } - - // A way to reference the inner property of a complex record. Can reference - // either a map key by literal, a struct field by the ordinal position of - // the desired field or a particular element in an array. Supports - // expressions that would roughly translate to something similar to: - // a.b[2].c['my_map_key'].x where a,b,c and x are struct field references - // (ordinalized in the internal representation here), [2] is a list offset - // and ['my_map_key'] is a reference into a map field. - message ReferenceSegment { - - oneof reference_type { - MapKey map_key = 1; - StructField struct_field = 2; - ListElement list_element = 3; - } - - message MapKey { - // literal based reference to specific possible value in map. - Literal map_key = 1; - - // Optional child segment - ReferenceSegment child = 2; - } - - message StructField { - // zero-indexed ordinal position of field in struct - int32 field = 1; - - // Optional child segment - ReferenceSegment child = 2; - } - - message ListElement { - // zero-indexed ordinal position of element in list - int32 offset = 1; - - // Optional child segment - ReferenceSegment child = 2; - } - - } - - // A reference that takes an existing subtype and selectively removes fields from - // it. For example, one might initially have an inner struct with 100 fields but a - // a particular operation only needs to interact with only 2 of those 100 fields. - // In this situation, one would use a mask expression to eliminate the 98 fields that - // are not relevant to the rest of the operation pipeline. - // - // Note that this does not fundamentally alter the structure of data beyond the - // elimination of unecessary elements. - message MaskExpression { - - StructSelect select = 1; - bool maintain_singular_struct = 2; - - message Select { - oneof type { - StructSelect struct_ = 1; - ListSelect list = 2; - MapSelect map = 3; - } - } - - message StructSelect { repeated StructItem struct_items = 1; } - - message StructItem { - int32 field = 1; - Select child = 2; - } - - message ListSelect { - - repeated ListSelectItem selection = 1; - Select child = 2; - - message ListSelectItem { - oneof type { - ListElement item = 1; - ListSlice slice = 2; - } - - message ListElement { int32 field = 1; } - - message ListSlice { - int32 start = 1; - int32 end = 2; - } - } - } - - message MapSelect { - oneof select { - MapKey key = 1; - MapKeyExpression expression = 2; - } - - Select child = 3; - - message MapKey { string map_key = 1; } - - message MapKeyExpression { string map_key_expression = 1; } - } - } - - // A reference to an inner part of a complex object. Can reference reference a single - // element or a masked version of elements - message FieldReference { - - // Whether this is composed of a single element reference or a masked element subtree - oneof reference_type { - ReferenceSegment direct_reference = 1; - MaskExpression masked_reference = 2; - } - - // Whether this reference has an origin of a root struct or is based on the ouput - // of an expression. When this is a RootReference and direct_reference above is used, - // the direct_reference must be of a type StructField. - oneof root_type { - Expression expression = 3; - RootReference root_reference = 4; - } - - // Singleton that expresses this FieldReference is rooted off the root incoming record type - message RootReference {} - - } -} - -message SortField { - Expression expr = 1; - - oneof sort_kind { - SortDirection direction = 2; - uint32 comparison_function_reference = 3; - } - enum SortDirection { - SORT_DIRECTION_UNSPECIFIED = 0; - SORT_DIRECTION_ASC_NULLS_FIRST = 1; - SORT_DIRECTION_ASC_NULLS_LAST = 2; - SORT_DIRECTION_DESC_NULLS_FIRST = 3; - SORT_DIRECTION_DESC_NULLS_LAST = 4; - SORT_DIRECTION_CLUSTERED = 5; - } -} - -enum AggregationPhase { - AGGREGATION_PHASE_UNSPECIFIED = 0; - AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE = 1; - AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE = 2; - AGGREGATION_PHASE_INITIAL_TO_RESULT = 3; - AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT = 4; -} - -message AggregateFunction { - // points to a function_anchor defined in this plan - uint32 function_reference = 1; - repeated Expression args = 2; - repeated SortField sorts = 3; - AggregationPhase phase = 4; - Type output_type = 5; -} diff --git a/inst/substrait/proto/substrait/extensions/extensions.proto b/inst/substrait/proto/substrait/extensions/extensions.proto index 86de8c6a..7262b584 100644 --- a/inst/substrait/proto/substrait/extensions/extensions.proto +++ b/inst/substrait/proto/substrait/extensions/extensions.proto @@ -1,12 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package substrait.extensions; import "substrait/any.proto"; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto/extensions"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; message SimpleExtensionURI { // A surrogate key used in the context of a single plan used to reference the @@ -21,7 +23,6 @@ message SimpleExtensionURI { // Describes a mapping between a specific extension entity and the uri where // that extension can be found. message SimpleExtensionDeclaration { - oneof mapping_type { ExtensionType extension_type = 1; ExtensionTypeVariation extension_type_variation = 2; @@ -71,7 +72,6 @@ message SimpleExtensionDeclaration { // A generic object that can be used to embed additional extension information // into the serialized substrait plan. message AdvancedExtension { - // An optimization is helpful information that don't influence semantics. May // be ignored by a consumer. Any optimization = 1; diff --git a/inst/substrait/proto/substrait/function.proto b/inst/substrait/proto/substrait/function.proto index 6b2eede9..7cc973c3 100644 --- a/inst/substrait/proto/substrait/function.proto +++ b/inst/substrait/proto/substrait/function.proto @@ -1,18 +1,19 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package substrait; -import "substrait/type.proto"; import "substrait/parameterized_types.proto"; +import "substrait/type.proto"; import "substrait/type_expressions.proto"; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; // List of function signatures available. message FunctionSignature { - message FinalArgVariadic { // the minimum number of arguments allowed for the list of final arguments // (inclusive). @@ -111,7 +112,6 @@ message FunctionSignature { } message Implementation { - Type type = 1; string uri = 2; @@ -136,7 +136,9 @@ message FunctionSignature { bool constant = 2; } - message TypeArgument { ParameterizedType type = 1; } + message TypeArgument { + ParameterizedType type = 1; + } message EnumArgument { repeated string options = 1; diff --git a/inst/substrait/proto/substrait/parameterized_types.proto b/inst/substrait/proto/substrait/parameterized_types.proto index 2b74d0fa..b3e01d59 100644 --- a/inst/substrait/proto/substrait/parameterized_types.proto +++ b/inst/substrait/proto/substrait/parameterized_types.proto @@ -1,14 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; + package substrait; import "substrait/type.proto"; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; message ParameterizedType { - oneof kind { Type.Boolean bool_ = 1; Type.I8 i8 = 2; @@ -36,7 +38,12 @@ message ParameterizedType { ParameterizedList list = 27; ParameterizedMap map = 28; - uint32 user_defined_pointer = 31; + ParameterizedUserDefined user_defined = 30; + + // Deprecated in favor of user_defined, which allows nullability and + // variations to be specified. If user_defined_pointer is encountered, + // treat it as being non-nullable and having the default variation. + uint32 user_defined_pointer = 31 [deprecated = true]; TypeParameter type_parameter = 33; } @@ -52,7 +59,9 @@ message ParameterizedType { NullableInteger range_end_exclusive = 3; } - message NullableInteger { int64 value = 1; } + message NullableInteger { + int64 value = 1; + } message ParameterizedFixedChar { IntegerOption length = 1; @@ -104,6 +113,12 @@ message ParameterizedType { Type.Nullability nullability = 4; } + message ParameterizedUserDefined { + uint32 type_pointer = 1; + uint32 variation_pointer = 2; + Type.Nullability nullability = 3; + } + message IntegerOption { oneof integer_type { int32 literal = 1; diff --git a/inst/substrait/proto/substrait/plan.proto b/inst/substrait/proto/substrait/plan.proto index 95978bdf..8614e08e 100644 --- a/inst/substrait/proto/substrait/plan.proto +++ b/inst/substrait/proto/substrait/plan.proto @@ -1,18 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package substrait; -import "substrait/relations.proto"; +import "substrait/algebra.proto"; import "substrait/extensions/extensions.proto"; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; // Either a relation or root relation message PlanRel { oneof rel_type { - // Any relation + // Any relation (used for references and CTEs) Rel rel = 1; // The root of a relation tree RelRoot root = 2; @@ -22,7 +24,6 @@ message PlanRel { // Describe a set of operations to complete. // For compactness sake, identifiers are normalized at the plan level. message Plan { - // a list of yaml specifications this plan may depend on repeated substrait.extensions.SimpleExtensionURI extension_uris = 1; diff --git a/inst/substrait/proto/substrait/relations.proto b/inst/substrait/proto/substrait/relations.proto deleted file mode 100644 index 6fd30081..00000000 --- a/inst/substrait/proto/substrait/relations.proto +++ /dev/null @@ -1,238 +0,0 @@ -syntax = "proto3"; - -package substrait; - -import "substrait/any.proto"; -import "substrait/type.proto"; -import "substrait/expression.proto"; -import "substrait/extensions/extensions.proto"; - -option java_multiple_files = true; -option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; - -message RelCommon { - - oneof emit_kind { - Direct direct = 1; - Emit emit = 2; - } - - Hint hint = 3; - substrait.extensions.AdvancedExtension advanced_extension = 4; - - message Direct {} - message Emit { repeated int32 output_mapping = 1; } - - // Changes to the operation that can influence efficiency/performance but - // should not impact correctness. - message Hint { - Stats stats = 1; - RuntimeConstraint constraint = 2; - substrait.extensions.AdvancedExtension advanced_extension = 10; - - message Stats { - double row_count = 1; - double record_size = 2; - substrait.extensions.AdvancedExtension advanced_extension = 10; - } - - message RuntimeConstraint { - // TODO: nodes, cpu threads/%, memory, iops, etc. - - substrait.extensions.AdvancedExtension advanced_extension = 10; - } - } -} - -message ReadRel { - RelCommon common = 1; - NamedStruct base_schema = 2; - Expression filter = 3; - Expression.MaskExpression projection = 4; - substrait.extensions.AdvancedExtension advanced_extension = 10; - - oneof read_type { - VirtualTable virtual_table = 5; - LocalFiles local_files = 6; - NamedTable named_table = 7; - ExtensionTable extension_table = 8; - } - - message NamedTable { - repeated string names = 1; - substrait.extensions.AdvancedExtension advanced_extension = 10; - } - - // a table composed of literals. - message VirtualTable { repeated Expression.Literal.Struct values = 1; } - - // a stub type that can be used to extend/introduce new table types outside - // the specification. - message ExtensionTable { Any detail = 1; } - - message LocalFiles { - - repeated FileOrFiles items = 1; - substrait.extensions.AdvancedExtension advanced_extension = 10; - - message FileOrFiles { - oneof path_type { - string uri_path = 1; - string uri_path_glob = 2; - string uri_file = 3; - string uri_folder = 4; - } - - FileFormat format = 5; - - // the index of the partition this item belongs to - uint64 partition_index = 6; - - // the start position in byte to read from this item - uint64 start = 7; - - // the length in byte to read from this item - uint64 length = 8; - - enum FileFormat { - FILE_FORMAT_UNSPECIFIED = 0; - FILE_FORMAT_PARQUET = 1; - } - } - } -} - -message ProjectRel { - RelCommon common = 1; - Rel input = 2; - repeated Expression expressions = 3; - substrait.extensions.AdvancedExtension advanced_extension = 10; -} - -message JoinRel { - RelCommon common = 1; - Rel left = 2; - Rel right = 3; - Expression expression = 4; - Expression post_join_filter = 5; - - JoinType type = 6; - - enum JoinType { - JOIN_TYPE_UNSPECIFIED = 0; - JOIN_TYPE_INNER = 1; - JOIN_TYPE_OUTER = 2; - JOIN_TYPE_LEFT = 3; - JOIN_TYPE_RIGHT = 4; - JOIN_TYPE_SEMI = 5; - JOIN_TYPE_ANTI = 6; - } - - substrait.extensions.AdvancedExtension advanced_extension = 10; -} - -message FetchRel { - RelCommon common = 1; - Rel input = 2; - int64 offset = 3; - int64 count = 4; - substrait.extensions.AdvancedExtension advanced_extension = 10; -} - -message AggregateRel { - RelCommon common = 1; - Rel input = 2; - repeated Grouping groupings = 3; - repeated Measure measures = 4; - - substrait.extensions.AdvancedExtension advanced_extension = 10; - - message Grouping { repeated Expression grouping_expressions = 1; } - - message Measure { - AggregateFunction measure = 1; - - // An optional boolean expression that acts to filter which records are - // included in the measure. True means include this record for calculation - // within the measure. - Expression filter = 2; - } -} - -message SortRel { - RelCommon common = 1; - Rel input = 2; - repeated SortField sorts = 3; - substrait.extensions.AdvancedExtension advanced_extension = 10; -} - -message FilterRel { - RelCommon common = 1; - Rel input = 2; - Expression condition = 3; - substrait.extensions.AdvancedExtension advanced_extension = 10; -} - -message SetRel { - RelCommon common = 1; - repeated Rel inputs = 2; - SetOp op = 3; - substrait.extensions.AdvancedExtension advanced_extension = 10; - - enum SetOp { - SET_OP_UNSPECIFIED = 0; - SET_OP_MINUS_PRIMARY = 1; - SET_OP_MINUS_MULTISET = 2; - SET_OP_INTERSECTION_PRIMARY = 3; - SET_OP_INTERSECTION_MULTISET = 4; - SET_OP_UNION_DISTINCT = 5; - SET_OP_UNION_ALL = 6; - } -} - -// Stub to support extension with a single input -message ExtensionSingleRel { - RelCommon common = 1; - Rel input = 2; - Any detail = 3; -} - -// Stub to support extension with a zero inputs -message ExtensionLeafRel { - RelCommon common = 1; - Any detail = 2; -} - -// Stub to support extension with multiple inputs -message ExtensionMultiRel { - RelCommon common = 1; - repeated Rel inputs = 2; - Any detail = 3; -} - -// A relation with output field names. -// -// This is for use at the root of a `Rel` tree. -message RelRoot { - // A relation - Rel input = 1; - // Field names in depth-first order - repeated string names = 2; -} - -message Rel { - oneof rel_type { - ReadRel read = 1; - FilterRel filter = 2; - FetchRel fetch = 3; - AggregateRel aggregate = 4; - SortRel sort = 5; - JoinRel join = 6; - ProjectRel project = 7; - SetRel set = 8; - ExtensionSingleRel extension_single = 9; - ExtensionMultiRel extension_multi = 10; - ExtensionLeafRel extension_leaf = 11; - } -} diff --git a/inst/substrait/proto/substrait/type.proto b/inst/substrait/proto/substrait/type.proto index 9cedba8a..c4b34220 100644 --- a/inst/substrait/proto/substrait/type.proto +++ b/inst/substrait/proto/substrait/type.proto @@ -1,12 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; + package substrait; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; message Type { - oneof kind { Boolean bool_ = 1; I8 i8 = 2; @@ -34,7 +36,13 @@ message Type { List list = 27; Map map = 28; - uint32 user_defined_type_reference = 31; + UserDefined user_defined = 30; + + // Deprecated in favor of user_defined, which allows nullability and + // variations to be specified. If user_defined_type_reference is + // encountered, treat it as being non-nullable and having the default + // variation. + uint32 user_defined_type_reference = 31 [deprecated = true]; } enum Nullability { @@ -47,6 +55,7 @@ message Type { uint32 type_variation_reference = 1; Nullability nullability = 2; } + message I8 { uint32 type_variation_reference = 1; Nullability nullability = 2; @@ -166,6 +175,12 @@ message Type { uint32 type_variation_reference = 3; Nullability nullability = 4; } + + message UserDefined { + uint32 type_reference = 1; + uint32 type_variation_reference = 2; + Nullability nullability = 3; + } } // A message for modeling name/type pairs. diff --git a/inst/substrait/proto/substrait/type_expressions.proto b/inst/substrait/proto/substrait/type_expressions.proto index 781d548f..44e3d978 100644 --- a/inst/substrait/proto/substrait/type_expressions.proto +++ b/inst/substrait/proto/substrait/type_expressions.proto @@ -1,14 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; + package substrait; import "substrait/type.proto"; +option csharp_namespace = "Substrait.Protobuf"; +option go_package = "github.com/substrait-io/substrait-go/proto"; option java_multiple_files = true; option java_package = "io.substrait.proto"; -option csharp_namespace = "Substrait.Protobuf"; message DerivationExpression { - oneof kind { Type.Boolean bool_ = 1; Type.I8 i8 = 2; @@ -36,7 +38,12 @@ message DerivationExpression { ExpressionList list = 27; ExpressionMap map = 28; - uint32 user_defined_pointer = 31; + ExpressionUserDefined user_defined = 30; + + // Deprecated in favor of user_defined, which allows nullability and + // variations to be specified. If user_defined_pointer is encountered, + // treat it as being non-nullable and having the default variation. + uint32 user_defined_pointer = 31 [deprecated = true]; string type_parameter_name = 33; string integer_parameter_name = 34; @@ -44,7 +51,7 @@ message DerivationExpression { int32 integer_literal = 35; UnaryOp unary_op = 36; BinaryOp binary_op = 37; - IfElse if_else = 38; + IfElse if_else_ = 38; ReturnProgram return_program = 39; } @@ -97,6 +104,12 @@ message DerivationExpression { Type.Nullability nullability = 4; } + message ExpressionUserDefined { + uint32 type_pointer = 1; + uint32 variation_pointer = 2; + Type.Nullability nullability = 3; + } + message IfElse { DerivationExpression if_condition = 1; DerivationExpression if_return = 2; @@ -114,7 +127,6 @@ message DerivationExpression { } message BinaryOp { - BinaryOpType op_type = 1; DerivationExpression arg1 = 2; DerivationExpression arg2 = 3; diff --git a/man/SubstraitCompiler.Rd b/man/SubstraitCompiler.Rd index d06f2e75..ffaf5994 100644 --- a/man/SubstraitCompiler.Rd +++ b/man/SubstraitCompiler.Rd @@ -17,7 +17,7 @@ will be used as leaf nodes when the plan is evaluated. Specific consumers will need to subclass the \link{SubstraitCompiler} and implement the \verb{$evaluate()} and/or \verb{$resolve_function()} methods. Typically users will not interact with R6 methods but will use the pipeable interface -(e.g. \code{\link[=substrait_project]{substrait_project()}}). The pipeable interface clones the compiler +(e.g. \code{\link[=substrait_select]{substrait_select()}}). The pipeable interface clones the compiler before it is modified to minimize the user's interaction to R6 reference semantics. @@ -190,7 +190,7 @@ A table-like object whose structure is defined by the \subsection{Method \code{resolve_function()}}{ Resolves an R function call as a Substrait function call. \subsection{Usage}{ -\if{html}{\out{
}}\preformatted{SubstraitCompiler$resolve_function(name, args, template)}\if{html}{\out{
}} +\if{html}{\out{
}}\preformatted{SubstraitCompiler$resolve_function(name, args, template, output_type = NULL)}\if{html}{\out{
}} } \subsection{Arguments}{ @@ -207,6 +207,9 @@ objects created while evaluating the user-provided arguments \item{\code{template}}{A \code{substrait.Expression.ScalarFunction}, a \code{substrait.Expression.WindowFunction}, or a \code{substrait.AggregateFunction}.} + +\item{\code{output_type}}{An explicit output type to use or a function accepting +one type per \code{args}.} } \if{html}{\out{}} } diff --git a/man/duckdb_get_substrait.Rd b/man/duckdb_get_substrait.Rd index 66909399..b056eaff 100644 --- a/man/duckdb_get_substrait.Rd +++ b/man/duckdb_get_substrait.Rd @@ -4,8 +4,6 @@ \alias{duckdb_get_substrait} \alias{duckdb_from_substrait} \alias{has_duckdb_with_substrait} -\alias{install_duckdb_with_substrait} -\alias{duckdb_with_substrait_lib_dir} \title{DuckDB Substrait Interface} \usage{ duckdb_get_substrait(sql, tables = list()) @@ -17,15 +15,7 @@ duckdb_from_substrait( as_data_frame = TRUE ) -has_duckdb_with_substrait(lib = duckdb_with_substrait_lib_dir()) - -install_duckdb_with_substrait( - lib = duckdb_with_substrait_lib_dir(), - force = TRUE, - quiet = FALSE -) - -duckdb_with_substrait_lib_dir() +has_duckdb_with_substrait() } \arguments{ \item{sql}{An SQL expression from which to generate a Substrait plan} @@ -38,10 +28,6 @@ duckdb_with_substrait_lib_dir() \item{as_data_frame}{Use \code{FALSE} to return an \link[arrow:Table]{arrow::Table} instead of a data.frame.} - -\item{lib}{A directry where the custom duckdb will be installed} - -\item{force, quiet}{Passed to the remotes installer} } \value{ \itemize{ diff --git a/man/example_data.Rd b/man/example_data.Rd index 3662039a..9011e5fa 100644 --- a/man/example_data.Rd +++ b/man/example_data.Rd @@ -8,83 +8,12 @@ An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 10 rows and 9 columns. } \usage{ -data(example_data) +example_data } \description{ Data for use in examples and tests with multiple different data types } -\details{ -Currently generated via: -example_data <- tibble::tibble( -int = c(-3212L, 2L, 3L, NA_integer_, 5L, 6L, 7L, 8L, 9L, -3212L), -dbl = c(-999, -99, -9, 0, -9, pi, 99, 10000, 10000, NA_real_), -dbl2 = c(-Inf, 5, 5, 5, 5, 5, 5, 5, 5, 5), -lgl = c(NA, TRUE, NA, TRUE, FALSE, FALSE, NA, TRUE, FALSE, TRUE), -false = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), -chr = c("a", "b", "c", "d", "e", NA, "g", "h", "i", "j"), -verses = c("Por cada muro, un lamento", "En Jerusalén la dorada", -"Y mil vidas malgastadas", "Por cada mandamiento", "Yo soy polvo de tu viento", -"Y aunque sangro de tu herida", "Y cada piedra querida", -"Guarda mi amor más profundo", "No hay una piedra en el mundo", -"Que valga lo que una vida"), -padded_strings = c(" a ", " b ", -" c ", " d ", " e ", " f ", " g ", -" h ", " i ", " j "), -some_negative = c(-1, 2, -3, NA, -5, 6, -7, 8, -9, 10)#, -} -\section{https://github.com/voltrondata/substrait-r/issues/80}{ - -} - -\section{dttm = lubridate::ymd_hms(c(}{ - -} - -\section{"0000-01-01 00:00:00",}{ - -} - -\section{"1919-05-29 13:08:55",}{ - -} - -\section{"1955-06-20 04:10:42",}{ - -} - -\section{"1973-06-30 11:38:41",}{ - -} - -\section{"1987-03-29 12:49:47",}{ - -} - -\section{"1991-06-11 19:07:01",}{ - -} - -\section{NA_character_,}{ - -} - -\section{"2017-08-21 18:26:40",}{ - - - -} - -\section{"9999-12-31 23:59:59"}{ - -} - -\section{))}{ -) -} - \examples{ -data(example_data) +example_data } \keyword{datasets} diff --git a/man/select.SubstraitCompiler.Rd b/man/select.SubstraitCompiler.Rd index 703bf0d1..2476becf 100644 --- a/man/select.SubstraitCompiler.Rd +++ b/man/select.SubstraitCompiler.Rd @@ -20,7 +20,7 @@ \method{rename}{SubstraitCompiler}(.data, ...) -\method{rename_with}{SubstraitCompiler}(.data, .fn, .cols = everything(), ...) +\method{rename_with}{SubstraitCompiler}(.data, .fn, .cols = dplyr::everything(), ...) \method{filter}{SubstraitCompiler}(.data, ...) diff --git a/man/substrait_compiler.Rd b/man/substrait_compiler.Rd index 00665111..ca40cd17 100644 --- a/man/substrait_compiler.Rd +++ b/man/substrait_compiler.Rd @@ -25,6 +25,6 @@ Creates a \link{SubstraitCompiler} instance initialized with \code{object} (e.g., a \code{data.frame()}). } \examples{ -substrait_compiler(data.frame(col1 = 1 , col2 = "one")) +substrait_compiler(data.frame(col1 = 1, col2 = "one")) } diff --git a/man/substrait_create.Rd b/man/substrait_create.Rd index e260b247..679d8cc1 100644 --- a/man/substrait_create.Rd +++ b/man/substrait_create.Rd @@ -6,7 +6,7 @@ \alias{substrait} \title{Create 'Substrait' message objects} \format{ -An object of class \code{list} of length 28. +An object of class \code{list} of length 32. } \usage{ substrait_create(.qualified_name, ...) diff --git a/man/substrait_project.Rd b/man/substrait_project.Rd index 1858f03c..1264af50 100644 --- a/man/substrait_project.Rd +++ b/man/substrait_project.Rd @@ -2,14 +2,20 @@ % Please edit documentation in R/project-rel.R \name{substrait_project} \alias{substrait_project} +\alias{substrait_select} \title{Append a Substrait Project Relation} \usage{ -substrait_project(.compiler, ...) +substrait_project(.compiler, ..., .drop_columns = character()) + +substrait_select(.compiler, ...) } \arguments{ \item{.compiler}{A \code{\link[=substrait_compiler]{substrait_compiler()}} or object that can be coerced to one} \item{...}{Expressions} + +\item{.drop_columns}{A character vector of columns to explicitly drop before +adding expressions specified in \code{...}.} } \value{ A modified \code{.compiler} @@ -18,9 +24,6 @@ A modified \code{.compiler} Append a Substrait Project Relation } \examples{ -substrait_project( - data.frame(a = 1, b = "one"), - c = a + 1 -) +substrait_select(data.frame(a = 1, b = "one"), c = a + 1) } diff --git a/src/expression.pb.c b/src/algebra.pb.c similarity index 59% rename from src/expression.pb.c rename to src/algebra.pb.c index 29fbf13f..997ce9e6 100644 --- a/src/expression.pb.c +++ b/src/algebra.pb.c @@ -1,11 +1,128 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ -#include "substrait/expression.pb.h" +#include "substrait/algebra.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif +PB_BIND(substrait_RelCommon, substrait_RelCommon, AUTO) + + +PB_BIND(substrait_RelCommon_Direct, substrait_RelCommon_Direct, AUTO) + + +PB_BIND(substrait_RelCommon_Emit, substrait_RelCommon_Emit, AUTO) + + +PB_BIND(substrait_RelCommon_Hint, substrait_RelCommon_Hint, AUTO) + + +PB_BIND(substrait_RelCommon_Hint_Stats, substrait_RelCommon_Hint_Stats, AUTO) + + +PB_BIND(substrait_RelCommon_Hint_RuntimeConstraint, substrait_RelCommon_Hint_RuntimeConstraint, AUTO) + + +PB_BIND(substrait_ReadRel, substrait_ReadRel, AUTO) + + +PB_BIND(substrait_ReadRel_NamedTable, substrait_ReadRel_NamedTable, AUTO) + + +PB_BIND(substrait_ReadRel_VirtualTable, substrait_ReadRel_VirtualTable, AUTO) + + +PB_BIND(substrait_ReadRel_ExtensionTable, substrait_ReadRel_ExtensionTable, AUTO) + + +PB_BIND(substrait_ReadRel_LocalFiles, substrait_ReadRel_LocalFiles, AUTO) + + +PB_BIND(substrait_ReadRel_LocalFiles_FileOrFiles, substrait_ReadRel_LocalFiles_FileOrFiles, AUTO) + + +PB_BIND(substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions, substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions, AUTO) + + +PB_BIND(substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions, substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions, AUTO) + + +PB_BIND(substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions, substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions, AUTO) + + +PB_BIND(substrait_ProjectRel, substrait_ProjectRel, AUTO) + + +PB_BIND(substrait_JoinRel, substrait_JoinRel, AUTO) + + +PB_BIND(substrait_CrossRel, substrait_CrossRel, AUTO) + + +PB_BIND(substrait_FetchRel, substrait_FetchRel, AUTO) + + +PB_BIND(substrait_AggregateRel, substrait_AggregateRel, AUTO) + + +PB_BIND(substrait_AggregateRel_Grouping, substrait_AggregateRel_Grouping, AUTO) + + +PB_BIND(substrait_AggregateRel_Measure, substrait_AggregateRel_Measure, AUTO) + + +PB_BIND(substrait_SortRel, substrait_SortRel, AUTO) + + +PB_BIND(substrait_FilterRel, substrait_FilterRel, AUTO) + + +PB_BIND(substrait_SetRel, substrait_SetRel, AUTO) + + +PB_BIND(substrait_ExtensionSingleRel, substrait_ExtensionSingleRel, AUTO) + + +PB_BIND(substrait_ExtensionLeafRel, substrait_ExtensionLeafRel, AUTO) + + +PB_BIND(substrait_ExtensionMultiRel, substrait_ExtensionMultiRel, AUTO) + + +PB_BIND(substrait_ExchangeRel, substrait_ExchangeRel, AUTO) + + +PB_BIND(substrait_ExchangeRel_ScatterFields, substrait_ExchangeRel_ScatterFields, AUTO) + + +PB_BIND(substrait_ExchangeRel_SingleBucketExpression, substrait_ExchangeRel_SingleBucketExpression, AUTO) + + +PB_BIND(substrait_ExchangeRel_MultiBucketExpression, substrait_ExchangeRel_MultiBucketExpression, AUTO) + + +PB_BIND(substrait_ExchangeRel_Broadcast, substrait_ExchangeRel_Broadcast, AUTO) + + +PB_BIND(substrait_ExchangeRel_RoundRobin, substrait_ExchangeRel_RoundRobin, AUTO) + + +PB_BIND(substrait_ExchangeRel_ExchangeTarget, substrait_ExchangeRel_ExchangeTarget, AUTO) + + +PB_BIND(substrait_RelRoot, substrait_RelRoot, AUTO) + + +PB_BIND(substrait_Rel, substrait_Rel, AUTO) + + +PB_BIND(substrait_FunctionArgument, substrait_FunctionArgument, AUTO) + + +PB_BIND(substrait_FunctionArgument_Enum, substrait_FunctionArgument_Enum, AUTO) + + PB_BIND(substrait_Expression, substrait_Expression, AUTO) @@ -42,6 +159,9 @@ PB_BIND(substrait_Expression_Literal_Struct, substrait_Expression_Literal_Struct PB_BIND(substrait_Expression_Literal_List, substrait_Expression_Literal_List, AUTO) +PB_BIND(substrait_Expression_Literal_UserDefined, substrait_Expression_Literal_UserDefined, AUTO) + + PB_BIND(substrait_Expression_ScalarFunction, substrait_Expression_ScalarFunction, AUTO) @@ -147,6 +267,24 @@ PB_BIND(substrait_Expression_FieldReference, substrait_Expression_FieldReference PB_BIND(substrait_Expression_FieldReference_RootReference, substrait_Expression_FieldReference_RootReference, AUTO) +PB_BIND(substrait_Expression_FieldReference_OuterReference, substrait_Expression_FieldReference_OuterReference, AUTO) + + +PB_BIND(substrait_Expression_Subquery, substrait_Expression_Subquery, AUTO) + + +PB_BIND(substrait_Expression_Subquery_Scalar, substrait_Expression_Subquery_Scalar, AUTO) + + +PB_BIND(substrait_Expression_Subquery_InPredicate, substrait_Expression_Subquery_InPredicate, AUTO) + + +PB_BIND(substrait_Expression_Subquery_SetPredicate, substrait_Expression_Subquery_SetPredicate, AUTO) + + +PB_BIND(substrait_Expression_Subquery_SetComparison, substrait_Expression_Subquery_SetComparison, AUTO) + + PB_BIND(substrait_SortField, substrait_SortField, AUTO) @@ -156,6 +294,13 @@ PB_BIND(substrait_AggregateFunction, substrait_AggregateFunction, AUTO) + + + + + + + #ifndef PB_CONVERT_DOUBLE_FLOAT /* On some platforms (such as AVR), double is really float. * To be able to encode/decode double on these platforms, you need. diff --git a/src/any.pb.c b/src/any.pb.c index c9efdb06..c09fd130 100644 --- a/src/any.pb.c +++ b/src/any.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/any.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -9,4 +9,7 @@ PB_BIND(substrait_Any, substrait_Any, AUTO) +PB_BIND(substrait_Empty, substrait_Empty, AUTO) + + diff --git a/src/capabilities.pb.c b/src/capabilities.pb.c index af21262a..6cee562e 100644 --- a/src/capabilities.pb.c +++ b/src/capabilities.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/capabilities.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/extensions.pb.c b/src/extensions.pb.c index 18e2b7f0..52750443 100644 --- a/src/extensions.pb.c +++ b/src/extensions.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/extensions/extensions.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/function.pb.c b/src/function.pb.c index ff5486da..fd0bfb76 100644 --- a/src/function.pb.c +++ b/src/function.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/function.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/parameterized_types.pb.c b/src/parameterized_types.pb.c index c5796243..5095a0ae 100644 --- a/src/parameterized_types.pb.c +++ b/src/parameterized_types.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/parameterized_types.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -42,6 +42,9 @@ PB_BIND(substrait_ParameterizedType_ParameterizedList, substrait_ParameterizedTy PB_BIND(substrait_ParameterizedType_ParameterizedMap, substrait_ParameterizedType_ParameterizedMap, AUTO) +PB_BIND(substrait_ParameterizedType_ParameterizedUserDefined, substrait_ParameterizedType_ParameterizedUserDefined, AUTO) + + PB_BIND(substrait_ParameterizedType_IntegerOption, substrait_ParameterizedType_IntegerOption, AUTO) diff --git a/src/pb.h b/src/pb.h index 0964cec9..f5c9c6f3 100644 --- a/src/pb.h +++ b/src/pb.h @@ -14,7 +14,8 @@ /* #define PB_ENABLE_MALLOC 1 */ /* Define this if your CPU / compiler combination does not support - * unaligned memory access to packed structures. */ + * unaligned memory access to packed structures. Note that packed + * structures are only used when requested in .proto options. */ /* #define PB_NO_PACKED_STRUCTS 1 */ /* Increase the number of required fields that are tracked. @@ -47,6 +48,15 @@ * the string processing slightly and slightly increases code size. */ /* #define PB_VALIDATE_UTF8 1 */ +/* This can be defined if the platform is little-endian and has 8-bit bytes. + * Normally it is automatically detected based on __BYTE_ORDER__ macro. */ +/* #define PB_LITTLE_ENDIAN_8BIT 1 */ + +/* Configure static assert mechanism. Instead of changing these, set your + * compiler to C11 standard mode if possible. */ +/* #define PB_C99_STATIC_ASSERT 1 */ +/* #define PB_NO_STATIC_ASSERT 1 */ + /****************************************************************** * You usually don't need to change anything below this line. * * Feel free to look around and use the defined macros, though. * @@ -55,7 +65,7 @@ /* Version of the nanopb library. Just in case you want to check it in * your own program. */ -#define NANOPB_VERSION nanopb-0.4.5 +#define NANOPB_VERSION "nanopb-0.4.6" /* Include all the system headers needed by nanopb. You will need the * definitions of the following: @@ -116,6 +126,18 @@ extern "C" { # define pb_packed #endif +/* Detect endianness */ +#ifndef PB_LITTLE_ENDIAN_8BIT +#if ((defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \ + (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \ + defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \ + defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \ + defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)) \ + && CHAR_BIT == 8 +#define PB_LITTLE_ENDIAN_8BIT 1 +#endif +#endif + /* Handly macro for suppressing unreferenced-parameter compiler warnings. */ #ifndef PB_UNUSED #define PB_UNUSED(x) (void)(x) @@ -145,14 +167,20 @@ extern "C" { */ #ifndef PB_NO_STATIC_ASSERT # ifndef PB_STATIC_ASSERT -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - /* C11 standard _Static_assert mechanism */ -# define PB_STATIC_ASSERT(COND,MSG) _Static_assert(COND,#MSG); -# else +# if defined(__ICCARM__) + /* IAR has static_assert keyword but no _Static_assert */ +# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG); +# elif defined(PB_C99_STATIC_ASSERT) /* Classic negative-size-array static assert mechanism */ # define PB_STATIC_ASSERT(COND,MSG) typedef char PB_STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1]; # define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) # define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##_##LINE##_##COUNTER +# elif defined(__cplusplus) + /* C++11 standard static_assert mechanism */ +# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG); +# else + /* C11 standard _Static_assert mechanism */ +# define PB_STATIC_ASSERT(COND,MSG) _Static_assert(COND,#MSG); # endif # endif #else @@ -160,6 +188,14 @@ extern "C" { # define PB_STATIC_ASSERT(COND,MSG) #endif +/* Test that PB_STATIC_ASSERT works + * If you get errors here, you may need to do one of these: + * - Enable C11 standard support in your compiler + * - Define PB_C99_STATIC_ASSERT to enable C99 standard support + * - Define PB_NO_STATIC_ASSERT to disable static asserts altogether + */ +PB_STATIC_ASSERT(1, STATIC_ASSERT_IS_NOT_WORKING) + /* Number of required fields to keep track of. */ #ifndef PB_MAX_REQUIRED_FIELDS #define PB_MAX_REQUIRED_FIELDS 64 @@ -377,7 +413,8 @@ typedef enum { PB_WT_VARINT = 0, PB_WT_64BIT = 1, PB_WT_STRING = 2, - PB_WT_32BIT = 5 + PB_WT_32BIT = 5, + PB_WT_PACKED = 255 /* PB_WT_PACKED is internal marker for packed arrays. */ } pb_wire_type_t; /* Structure for defining the handling of unknown/extension fields. @@ -872,4 +909,3 @@ template struct MessageDescriptor; #endif /* __cplusplus */ #endif - diff --git a/src/pb_decode.c b/src/pb_decode.c index b1948254..5405c87d 100644 --- a/src/pb_decode.c +++ b/src/pb_decode.c @@ -57,8 +57,6 @@ static void pb_release_single_field(pb_field_iter_t *field); #define pb_uint64_t uint64_t #endif -#define PB_WT_PACKED ((pb_wire_type_t)0xFF) - typedef struct { uint32_t bitfield[(PB_MAX_REQUIRED_FIELDS + 31) / 32]; } pb_fields_seen_t; @@ -69,14 +67,12 @@ typedef struct { static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) { - size_t i; const pb_byte_t *source = (const pb_byte_t*)stream->state; stream->state = (pb_byte_t*)stream->state + count; if (buf != NULL) { - for (i = 0; i < count; i++) - buf[i] = source[i]; + memcpy(buf, source, count * sizeof(pb_byte_t)); } return true; @@ -213,18 +209,20 @@ static bool checkreturn pb_decode_varint32_eof(pb_istream_t *stream, uint32_t *d PB_RETURN_ERROR(stream, "varint overflow"); } } + else if (bitpos == 28) + { + if ((byte & 0x70) != 0 && (byte & 0x78) != 0x78) + { + PB_RETURN_ERROR(stream, "varint overflow"); + } + result |= (uint32_t)(byte & 0x0F) << bitpos; + } else { result |= (uint32_t)(byte & 0x7F) << bitpos; } bitpos = (uint_fast8_t)(bitpos + 7); } while (byte & 0x80); - - if (bitpos == 35 && (byte & 0x70) != 0) - { - /* The last byte was at bitpos=28, so only bottom 4 bits fit. */ - PB_RETURN_ERROR(stream, "varint overflow"); - } } *dest = result; @@ -245,12 +243,12 @@ bool checkreturn pb_decode_varint(pb_istream_t *stream, uint64_t *dest) do { - if (bitpos >= 64) - PB_RETURN_ERROR(stream, "varint overflow"); - if (!pb_readbyte(stream, &byte)) return false; + if (bitpos >= 63 && (byte & 0xFE) != 0) + PB_RETURN_ERROR(stream, "varint overflow"); + result |= (uint64_t)(byte & 0x7F) << bitpos; bitpos = (uint_fast8_t)(bitpos + 7); } while (byte & 0x80); @@ -703,6 +701,12 @@ static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_ /* Decode the array entry */ field->pData = *(char**)field->pField + field->data_size * (*size); + if (field->pData == NULL) + { + /* Shouldn't happen, but satisfies static analyzers */ + status = false; + break; + } initialize_pointer_field(field->pData, field); if (!decode_basic_field(&substream, PB_WT_PACKED, field)) { @@ -757,7 +761,10 @@ static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type { prev_bytes_left = substream.bytes_left; if (!field->descriptor->field_callback(&substream, NULL, field)) - PB_RETURN_ERROR(stream, "callback failed"); + { + PB_SET_ERROR(stream, substream.errmsg ? substream.errmsg : "callback failed"); + return false; + } } while (substream.bytes_left > 0 && substream.bytes_left < prev_bytes_left); if (!pb_close_string_substream(stream, &substream)) @@ -1358,7 +1365,7 @@ bool pb_decode_fixed32(pb_istream_t *stream, void *dest) if (!pb_read(stream, u.bytes, 4)) return false; -#if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN && CHAR_BIT == 8 +#if defined(PB_LITTLE_ENDIAN_8BIT) && PB_LITTLE_ENDIAN_8BIT == 1 /* fast path - if we know that we're on little endian, assign directly */ *(uint32_t*)dest = u.fixed32; #else @@ -1381,7 +1388,7 @@ bool pb_decode_fixed64(pb_istream_t *stream, void *dest) if (!pb_read(stream, u.bytes, 8)) return false; -#if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN && CHAR_BIT == 8 +#if defined(PB_LITTLE_ENDIAN_8BIT) && PB_LITTLE_ENDIAN_8BIT == 1 /* fast path - if we know that we're on little endian, assign directly */ *(uint64_t*)dest = u.fixed64; #else diff --git a/src/pb_encode.c b/src/pb_encode.c index de716f7a..7f562012 100644 --- a/src/pb_encode.c +++ b/src/pb_encode.c @@ -51,12 +51,10 @@ static bool checkreturn pb_enc_fixed_length_bytes(pb_ostream_t *stream, const pb static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) { - size_t i; pb_byte_t *dest = (pb_byte_t*)stream->state; stream->state = dest + count; - for (i = 0; i < count; i++) - dest[i] = buf[i]; + memcpy(dest, buf, count * sizeof(pb_byte_t)); return true; } @@ -65,7 +63,11 @@ pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize) { pb_ostream_t stream; #ifdef PB_BUFFER_ONLY - stream.callback = (void*)1; /* Just a marker value */ + /* In PB_BUFFER_ONLY configuration the callback pointer is just int*. + * NULL pointer marks a sizing field, so put a non-NULL value to mark a buffer stream. + */ + static const int marker = 0; + stream.callback = ▮ #else stream.callback = &buf_write; #endif @@ -622,8 +624,9 @@ bool checkreturn pb_encode_varint(pb_ostream_t *stream, pb_uint64_t value) bool checkreturn pb_encode_svarint(pb_ostream_t *stream, pb_int64_t value) { pb_uint64_t zigzagged; + pb_uint64_t mask = ((pb_uint64_t)-1) >> 1; /* Satisfy clang -fsanitize=integer */ if (value < 0) - zigzagged = ~((pb_uint64_t)value << 1); + zigzagged = ~(((pb_uint64_t)value & mask) << 1); else zigzagged = (pb_uint64_t)value << 1; @@ -632,6 +635,10 @@ bool checkreturn pb_encode_svarint(pb_ostream_t *stream, pb_int64_t value) bool checkreturn pb_encode_fixed32(pb_ostream_t *stream, const void *value) { +#if defined(PB_LITTLE_ENDIAN_8BIT) && PB_LITTLE_ENDIAN_8BIT == 1 + /* Fast path if we know that we're on little endian */ + return pb_write(stream, (const pb_byte_t*)value, 4); +#else uint32_t val = *(const uint32_t*)value; pb_byte_t bytes[4]; bytes[0] = (pb_byte_t)(val & 0xFF); @@ -639,11 +646,16 @@ bool checkreturn pb_encode_fixed32(pb_ostream_t *stream, const void *value) bytes[2] = (pb_byte_t)((val >> 16) & 0xFF); bytes[3] = (pb_byte_t)((val >> 24) & 0xFF); return pb_write(stream, bytes, 4); +#endif } #ifndef PB_WITHOUT_64BIT bool checkreturn pb_encode_fixed64(pb_ostream_t *stream, const void *value) { +#if defined(PB_LITTLE_ENDIAN_8BIT) && PB_LITTLE_ENDIAN_8BIT == 1 + /* Fast path if we know that we're on little endian */ + return pb_write(stream, (const pb_byte_t*)value, 8); +#else uint64_t val = *(const uint64_t*)value; pb_byte_t bytes[8]; bytes[0] = (pb_byte_t)(val & 0xFF); @@ -655,6 +667,7 @@ bool checkreturn pb_encode_fixed64(pb_ostream_t *stream, const void *value) bytes[6] = (pb_byte_t)((val >> 48) & 0xFF); bytes[7] = (pb_byte_t)((val >> 56) & 0xFF); return pb_write(stream, bytes, 8); +#endif } #endif diff --git a/src/pb_encode.h b/src/pb_encode.h index 9cff22a4..89136832 100644 --- a/src/pb_encode.h +++ b/src/pb_encode.h @@ -33,7 +33,7 @@ struct pb_ostream_s * Also, NULL pointer marks a 'sizing stream' that does not * write anything. */ - int *callback; + const int *callback; #else bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); #endif diff --git a/src/plan.pb.c b/src/plan.pb.c index fa3e209a..c055abdd 100644 --- a/src/plan.pb.c +++ b/src/plan.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/plan.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/src/relations.pb.c b/src/relations.pb.c deleted file mode 100644 index 9530ec85..00000000 --- a/src/relations.pb.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ - -#include "substrait/relations.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(substrait_RelCommon, substrait_RelCommon, AUTO) - - -PB_BIND(substrait_RelCommon_Direct, substrait_RelCommon_Direct, AUTO) - - -PB_BIND(substrait_RelCommon_Emit, substrait_RelCommon_Emit, AUTO) - - -PB_BIND(substrait_RelCommon_Hint, substrait_RelCommon_Hint, AUTO) - - -PB_BIND(substrait_RelCommon_Hint_Stats, substrait_RelCommon_Hint_Stats, AUTO) - - -PB_BIND(substrait_RelCommon_Hint_RuntimeConstraint, substrait_RelCommon_Hint_RuntimeConstraint, AUTO) - - -PB_BIND(substrait_ReadRel, substrait_ReadRel, AUTO) - - -PB_BIND(substrait_ReadRel_NamedTable, substrait_ReadRel_NamedTable, AUTO) - - -PB_BIND(substrait_ReadRel_VirtualTable, substrait_ReadRel_VirtualTable, AUTO) - - -PB_BIND(substrait_ReadRel_ExtensionTable, substrait_ReadRel_ExtensionTable, AUTO) - - -PB_BIND(substrait_ReadRel_LocalFiles, substrait_ReadRel_LocalFiles, AUTO) - - -PB_BIND(substrait_ReadRel_LocalFiles_FileOrFiles, substrait_ReadRel_LocalFiles_FileOrFiles, AUTO) - - -PB_BIND(substrait_ProjectRel, substrait_ProjectRel, AUTO) - - -PB_BIND(substrait_JoinRel, substrait_JoinRel, AUTO) - - -PB_BIND(substrait_FetchRel, substrait_FetchRel, AUTO) - - -PB_BIND(substrait_AggregateRel, substrait_AggregateRel, AUTO) - - -PB_BIND(substrait_AggregateRel_Grouping, substrait_AggregateRel_Grouping, AUTO) - - -PB_BIND(substrait_AggregateRel_Measure, substrait_AggregateRel_Measure, AUTO) - - -PB_BIND(substrait_SortRel, substrait_SortRel, AUTO) - - -PB_BIND(substrait_FilterRel, substrait_FilterRel, AUTO) - - -PB_BIND(substrait_SetRel, substrait_SetRel, AUTO) - - -PB_BIND(substrait_ExtensionSingleRel, substrait_ExtensionSingleRel, AUTO) - - -PB_BIND(substrait_ExtensionLeafRel, substrait_ExtensionLeafRel, AUTO) - - -PB_BIND(substrait_ExtensionMultiRel, substrait_ExtensionMultiRel, AUTO) - - -PB_BIND(substrait_RelRoot, substrait_RelRoot, AUTO) - - -PB_BIND(substrait_Rel, substrait_Rel, AUTO) - - - - - - -#ifndef PB_CONVERT_DOUBLE_FLOAT -/* On some platforms (such as AVR), double is really float. - * To be able to encode/decode double on these platforms, you need. - * to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line. - */ -PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) -#endif - diff --git a/src/substrait/algebra.pb.h b/src/substrait/algebra.pb.h new file mode 100644 index 00000000..ab316527 --- /dev/null +++ b/src/substrait/algebra.pb.h @@ -0,0 +1,2491 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.6 */ + +#ifndef PB_SUBSTRAIT_SUBSTRAIT_ALGEBRA_PB_H_INCLUDED +#define PB_SUBSTRAIT_SUBSTRAIT_ALGEBRA_PB_H_INCLUDED +#include +#include "substrait/any.pb.h" +#include "substrait/extensions/extensions.pb.h" +#include "substrait/type.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +typedef enum _substrait_AggregationPhase { + substrait_AggregationPhase_AGGREGATION_PHASE_UNSPECIFIED = 0, + substrait_AggregationPhase_AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE = 1, + substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE = 2, + substrait_AggregationPhase_AGGREGATION_PHASE_INITIAL_TO_RESULT = 3, + substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT = 4 +} substrait_AggregationPhase; + +typedef enum _substrait_JoinRel_JoinType { + substrait_JoinRel_JoinType_JOIN_TYPE_UNSPECIFIED = 0, + substrait_JoinRel_JoinType_JOIN_TYPE_INNER = 1, + substrait_JoinRel_JoinType_JOIN_TYPE_OUTER = 2, + substrait_JoinRel_JoinType_JOIN_TYPE_LEFT = 3, + substrait_JoinRel_JoinType_JOIN_TYPE_RIGHT = 4, + substrait_JoinRel_JoinType_JOIN_TYPE_SEMI = 5, + substrait_JoinRel_JoinType_JOIN_TYPE_ANTI = 6, + substrait_JoinRel_JoinType_JOIN_TYPE_SINGLE = 7 +} substrait_JoinRel_JoinType; + +typedef enum _substrait_SetRel_SetOp { + substrait_SetRel_SetOp_SET_OP_UNSPECIFIED = 0, + substrait_SetRel_SetOp_SET_OP_MINUS_PRIMARY = 1, + substrait_SetRel_SetOp_SET_OP_MINUS_MULTISET = 2, + substrait_SetRel_SetOp_SET_OP_INTERSECTION_PRIMARY = 3, + substrait_SetRel_SetOp_SET_OP_INTERSECTION_MULTISET = 4, + substrait_SetRel_SetOp_SET_OP_UNION_DISTINCT = 5, + substrait_SetRel_SetOp_SET_OP_UNION_ALL = 6 +} substrait_SetRel_SetOp; + +typedef enum _substrait_Expression_Cast_FailureBehavior { + substrait_Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_UNSPECIFIED = 0, + substrait_Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_RETURN_NULL = 1, + substrait_Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_THROW_EXCEPTION = 2 +} substrait_Expression_Cast_FailureBehavior; + +typedef enum _substrait_Expression_Subquery_SetPredicate_PredicateOp { + substrait_Expression_Subquery_SetPredicate_PredicateOp_PREDICATE_OP_UNSPECIFIED = 0, + substrait_Expression_Subquery_SetPredicate_PredicateOp_PREDICATE_OP_EXISTS = 1, + substrait_Expression_Subquery_SetPredicate_PredicateOp_PREDICATE_OP_UNIQUE = 2 +} substrait_Expression_Subquery_SetPredicate_PredicateOp; + +typedef enum _substrait_Expression_Subquery_SetComparison_ComparisonOp { + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_UNSPECIFIED = 0, + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_EQ = 1, + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_NE = 2, + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_LT = 3, + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_GT = 4, + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_LE = 5, + substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_GE = 6 +} substrait_Expression_Subquery_SetComparison_ComparisonOp; + +typedef enum _substrait_Expression_Subquery_SetComparison_ReductionOp { + substrait_Expression_Subquery_SetComparison_ReductionOp_REDUCTION_OP_UNSPECIFIED = 0, + substrait_Expression_Subquery_SetComparison_ReductionOp_REDUCTION_OP_ANY = 1, + substrait_Expression_Subquery_SetComparison_ReductionOp_REDUCTION_OP_ALL = 2 +} substrait_Expression_Subquery_SetComparison_ReductionOp; + +typedef enum _substrait_SortField_SortDirection { + substrait_SortField_SortDirection_SORT_DIRECTION_UNSPECIFIED = 0, + substrait_SortField_SortDirection_SORT_DIRECTION_ASC_NULLS_FIRST = 1, + substrait_SortField_SortDirection_SORT_DIRECTION_ASC_NULLS_LAST = 2, + substrait_SortField_SortDirection_SORT_DIRECTION_DESC_NULLS_FIRST = 3, + substrait_SortField_SortDirection_SORT_DIRECTION_DESC_NULLS_LAST = 4, + substrait_SortField_SortDirection_SORT_DIRECTION_CLUSTERED = 5 +} substrait_SortField_SortDirection; + +typedef enum _substrait_AggregateFunction_AggregationInvocation { + substrait_AggregateFunction_AggregationInvocation_AGGREGATION_INVOCATION_UNSPECIFIED = 0, + substrait_AggregateFunction_AggregationInvocation_AGGREGATION_INVOCATION_ALL = 1, + substrait_AggregateFunction_AggregationInvocation_AGGREGATION_INVOCATION_DISTINCT = 2 +} substrait_AggregateFunction_AggregationInvocation; + +/* Struct definitions */ +typedef struct _substrait_AggregateFunction { + uint32_t *function_reference; + pb_size_t args_count; + struct _substrait_Expression *args; + pb_size_t sorts_count; + struct _substrait_SortField *sorts; + substrait_AggregationPhase *phase; + struct _substrait_Type *output_type; + substrait_AggregateFunction_AggregationInvocation *invocation; + pb_size_t arguments_count; + struct _substrait_FunctionArgument *arguments; +} substrait_AggregateFunction; + +typedef struct _substrait_AggregateRel { + /* points to a function_anchor defined in this plan */ + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + pb_size_t groupings_count; + struct _substrait_AggregateRel_Grouping *groupings; + pb_size_t measures_count; + struct _substrait_AggregateRel_Measure *measures; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_AggregateRel; + +typedef struct _substrait_AggregateRel_Grouping { + pb_size_t grouping_expressions_count; + struct _substrait_Expression *grouping_expressions; +} substrait_AggregateRel_Grouping; + +typedef struct _substrait_AggregateRel_Measure { + struct _substrait_AggregateFunction *measure; + struct _substrait_Expression *filter; +} substrait_AggregateRel_Measure; + +typedef struct _substrait_CrossRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *left; + struct _substrait_Rel *right; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_CrossRel; + +typedef struct _substrait_ExchangeRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + int32_t *partition_count; + pb_size_t targets_count; + struct _substrait_ExchangeRel_ExchangeTarget *targets; + pb_size_t which_exchange_kind; + union { + struct _substrait_ExchangeRel_ScatterFields *scatter_by_fields; + struct _substrait_ExchangeRel_SingleBucketExpression *single_target; + struct _substrait_ExchangeRel_MultiBucketExpression *multi_target; + struct _substrait_ExchangeRel_RoundRobin *round_robin; + struct _substrait_ExchangeRel_Broadcast *broadcast; + } exchange_kind; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_ExchangeRel; + +typedef struct _substrait_ExchangeRel_Broadcast { + char dummy_field; +} substrait_ExchangeRel_Broadcast; + +typedef struct _substrait_ExchangeRel_ExchangeTarget { + pb_size_t partition_id_count; + int32_t *partition_id; + pb_size_t which_target_type; + union { + char *uri; + struct _substrait_Any *extended; + } target_type; +} substrait_ExchangeRel_ExchangeTarget; + +typedef struct _substrait_ExchangeRel_MultiBucketExpression { + struct _substrait_Expression *expression; + bool *constrained_to_count; +} substrait_ExchangeRel_MultiBucketExpression; + +typedef struct _substrait_ExchangeRel_RoundRobin { + bool *exact; +} substrait_ExchangeRel_RoundRobin; + +typedef struct _substrait_ExchangeRel_ScatterFields { + pb_size_t fields_count; + struct _substrait_Expression_FieldReference *fields; +} substrait_ExchangeRel_ScatterFields; + +typedef struct _substrait_ExchangeRel_SingleBucketExpression { + struct _substrait_Expression *expression; +} substrait_ExchangeRel_SingleBucketExpression; + +typedef struct _substrait_Expression { + pb_size_t which_rex_type; + union { + struct _substrait_Expression_Literal *literal; + struct _substrait_Expression_FieldReference *selection; + struct _substrait_Expression_ScalarFunction *scalar_function; + struct _substrait_Expression_WindowFunction *window_function; + struct _substrait_Expression_IfThen *if_then; + struct _substrait_Expression_SwitchExpression *switch_expression; + struct _substrait_Expression_SingularOrList *singular_or_list; + struct _substrait_Expression_MultiOrList *multi_or_list; + struct _substrait_Expression_Enum *enum_; + struct _substrait_Expression_Cast *cast; + struct _substrait_Expression_Subquery *subquery; + } rex_type; +} substrait_Expression; + +typedef struct _substrait_Expression_Cast { + struct _substrait_Type *type; + struct _substrait_Expression *input; + substrait_Expression_Cast_FailureBehavior *failure_behavior; +} substrait_Expression_Cast; + +typedef struct _substrait_Expression_EmbeddedFunction { + pb_size_t arguments_count; + struct _substrait_Expression *arguments; + struct _substrait_Type *output_type; + pb_size_t which_kind; + union { + struct _substrait_Expression_EmbeddedFunction_PythonPickleFunction *python_pickle_function; + struct _substrait_Expression_EmbeddedFunction_WebAssemblyFunction *web_assembly_function; + } kind; +} substrait_Expression_EmbeddedFunction; + +typedef struct _substrait_Expression_EmbeddedFunction_PythonPickleFunction { + pb_bytes_array_t *function_; + pb_size_t prerequisite_count; + char **prerequisite; +} substrait_Expression_EmbeddedFunction_PythonPickleFunction; + +typedef struct _substrait_Expression_EmbeddedFunction_WebAssemblyFunction { + pb_bytes_array_t *script; + pb_size_t prerequisite_count; + char **prerequisite; +} substrait_Expression_EmbeddedFunction_WebAssemblyFunction; + +typedef struct _substrait_Expression_Enum { + pb_size_t which_enum_kind; + union { + char *specified; + struct _substrait_Expression_Enum_Empty *unspecified; + } enum_kind; +} substrait_Expression_Enum; + +typedef struct _substrait_Expression_Enum_Empty { + char dummy_field; +} substrait_Expression_Enum_Empty; + +typedef struct _substrait_Expression_FieldReference { + pb_size_t which_reference_type; + union { + struct _substrait_Expression_ReferenceSegment *direct_reference; + struct _substrait_Expression_MaskExpression *masked_reference; + } reference_type; + pb_size_t which_root_type; + union { + struct _substrait_Expression *expression; + struct _substrait_Expression_FieldReference_RootReference *root_reference; + struct _substrait_Expression_FieldReference_OuterReference *outer_reference; + } root_type; +} substrait_Expression_FieldReference; + +typedef struct _substrait_Expression_FieldReference_OuterReference { + uint32_t *steps_out; +} substrait_Expression_FieldReference_OuterReference; + +typedef struct _substrait_Expression_FieldReference_RootReference { + char dummy_field; +} substrait_Expression_FieldReference_RootReference; + +typedef struct _substrait_Expression_IfThen { + pb_size_t ifs_count; + struct _substrait_Expression_IfThen_IfClause *ifs; + struct _substrait_Expression *else_; +} substrait_Expression_IfThen; + +typedef struct _substrait_Expression_IfThen_IfClause { + struct _substrait_Expression *if_; + struct _substrait_Expression *then; +} substrait_Expression_IfThen_IfClause; + +typedef struct _substrait_Expression_Literal { + pb_size_t which_literal_type; + union { + bool *boolean; + int32_t *i8; + int32_t *i16; + int32_t *i32; + int64_t *i64; + float *fp32; + double *fp64; + char *string; + pb_bytes_array_t *binary; + int64_t *timestamp; + int32_t *date; + int64_t *time; + struct _substrait_Expression_Literal_IntervalYearToMonth *interval_year_to_month; + struct _substrait_Expression_Literal_IntervalDayToSecond *interval_day_to_second; + char *fixed_char; + struct _substrait_Expression_Literal_VarChar *var_char; + pb_bytes_array_t *fixed_binary; + struct _substrait_Expression_Literal_Decimal *decimal; + struct _substrait_Expression_Literal_Struct *struct_; + struct _substrait_Expression_Literal_Map *map; + int64_t *timestamp_tz; + pb_bytes_array_t *uuid; + struct _substrait_Type *null; + struct _substrait_Expression_Literal_List *list; + struct _substrait_Type_List *empty_list; + struct _substrait_Type_Map *empty_map; + struct _substrait_Expression_Literal_UserDefined *user_defined; + } literal_type; + bool *nullable; + uint32_t *type_variation_reference; +} substrait_Expression_Literal; + +typedef struct _substrait_Expression_Literal_Decimal { + pb_bytes_array_t *value; + int32_t *precision; + int32_t *scale; +} substrait_Expression_Literal_Decimal; + +typedef struct _substrait_Expression_Literal_IntervalDayToSecond { + int32_t *days; + int32_t *seconds; + int32_t *microseconds; +} substrait_Expression_Literal_IntervalDayToSecond; + +typedef struct _substrait_Expression_Literal_IntervalYearToMonth { + int32_t *years; + int32_t *months; +} substrait_Expression_Literal_IntervalYearToMonth; + +typedef struct _substrait_Expression_Literal_List { + pb_size_t values_count; + struct _substrait_Expression_Literal *values; +} substrait_Expression_Literal_List; + +typedef struct _substrait_Expression_Literal_Map { + pb_size_t key_values_count; + struct _substrait_Expression_Literal_Map_KeyValue *key_values; +} substrait_Expression_Literal_Map; + +typedef struct _substrait_Expression_Literal_Map_KeyValue { + struct _substrait_Expression_Literal *key; + struct _substrait_Expression_Literal *value; +} substrait_Expression_Literal_Map_KeyValue; + +typedef struct _substrait_Expression_Literal_Struct { + pb_size_t fields_count; + struct _substrait_Expression_Literal *fields; +} substrait_Expression_Literal_Struct; + +typedef struct _substrait_Expression_Literal_UserDefined { + uint32_t *type_reference; + struct _substrait_Any *value; +} substrait_Expression_Literal_UserDefined; + +typedef struct _substrait_Expression_Literal_VarChar { + char *value; + uint32_t *length; +} substrait_Expression_Literal_VarChar; + +typedef struct _substrait_Expression_MaskExpression { + struct _substrait_Expression_MaskExpression_StructSelect *select; + bool *maintain_singular_struct_; +} substrait_Expression_MaskExpression; + +typedef struct _substrait_Expression_MaskExpression_ListSelect { + pb_size_t selection_count; + struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem *selection; + struct _substrait_Expression_MaskExpression_Select *child; +} substrait_Expression_MaskExpression_ListSelect; + +typedef struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem { + pb_size_t which_type; + union { + struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement *item; + struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice *slice; + } type; +} substrait_Expression_MaskExpression_ListSelect_ListSelectItem; + +typedef struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement { + int32_t *field; +} substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement; + +typedef struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice { + int32_t *start; + int32_t *end; +} substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice; + +typedef struct _substrait_Expression_MaskExpression_MapSelect { + pb_size_t which_select; + union { + struct _substrait_Expression_MaskExpression_MapSelect_MapKey *key; + struct _substrait_Expression_MaskExpression_MapSelect_MapKeyExpression *expression; + } select; + struct _substrait_Expression_MaskExpression_Select *child; +} substrait_Expression_MaskExpression_MapSelect; + +typedef struct _substrait_Expression_MaskExpression_MapSelect_MapKey { + char *map_key; +} substrait_Expression_MaskExpression_MapSelect_MapKey; + +typedef struct _substrait_Expression_MaskExpression_MapSelect_MapKeyExpression { + char *map_key_expression; +} substrait_Expression_MaskExpression_MapSelect_MapKeyExpression; + +typedef struct _substrait_Expression_MaskExpression_Select { + pb_size_t which_type; + union { + struct _substrait_Expression_MaskExpression_StructSelect *struct_; + struct _substrait_Expression_MaskExpression_ListSelect *list; + struct _substrait_Expression_MaskExpression_MapSelect *map; + } type; +} substrait_Expression_MaskExpression_Select; + +typedef struct _substrait_Expression_MaskExpression_StructItem { + int32_t *field; + struct _substrait_Expression_MaskExpression_Select *child; +} substrait_Expression_MaskExpression_StructItem; + +typedef struct _substrait_Expression_MaskExpression_StructSelect { + pb_size_t struct_items_count; + struct _substrait_Expression_MaskExpression_StructItem *struct_items; +} substrait_Expression_MaskExpression_StructSelect; + +typedef struct _substrait_Expression_MultiOrList { + pb_size_t value_count; + struct _substrait_Expression *value; + pb_size_t options_count; + struct _substrait_Expression_MultiOrList_Record *options; +} substrait_Expression_MultiOrList; + +typedef struct _substrait_Expression_MultiOrList_Record { + pb_size_t fields_count; + struct _substrait_Expression *fields; +} substrait_Expression_MultiOrList_Record; + +typedef struct _substrait_Expression_ReferenceSegment { + pb_size_t which_reference_type; + union { + struct _substrait_Expression_ReferenceSegment_MapKey *map_key; + struct _substrait_Expression_ReferenceSegment_StructField *struct_field; + struct _substrait_Expression_ReferenceSegment_ListElement *list_element; + } reference_type; +} substrait_Expression_ReferenceSegment; + +typedef struct _substrait_Expression_ReferenceSegment_ListElement { + int32_t *offset; + struct _substrait_Expression_ReferenceSegment *child; +} substrait_Expression_ReferenceSegment_ListElement; + +typedef struct _substrait_Expression_ReferenceSegment_MapKey { + struct _substrait_Expression_Literal *map_key; + struct _substrait_Expression_ReferenceSegment *child; +} substrait_Expression_ReferenceSegment_MapKey; + +typedef struct _substrait_Expression_ReferenceSegment_StructField { + int32_t *field; + struct _substrait_Expression_ReferenceSegment *child; +} substrait_Expression_ReferenceSegment_StructField; + +typedef struct _substrait_Expression_ScalarFunction { + uint32_t *function_reference; + pb_size_t args_count; + struct _substrait_Expression *args; + struct _substrait_Type *output_type; + pb_size_t arguments_count; + struct _substrait_FunctionArgument *arguments; +} substrait_Expression_ScalarFunction; + +typedef struct _substrait_Expression_SingularOrList { + struct _substrait_Expression *value; + pb_size_t options_count; + struct _substrait_Expression *options; +} substrait_Expression_SingularOrList; + +typedef struct _substrait_Expression_Subquery { + pb_size_t which_subquery_type; + union { + struct _substrait_Expression_Subquery_Scalar *scalar; + struct _substrait_Expression_Subquery_InPredicate *in_predicate; + struct _substrait_Expression_Subquery_SetPredicate *set_predicate; + struct _substrait_Expression_Subquery_SetComparison *set_comparison; + } subquery_type; +} substrait_Expression_Subquery; + +typedef struct _substrait_Expression_Subquery_InPredicate { + pb_size_t needles_count; + struct _substrait_Expression *needles; + struct _substrait_Rel *haystack; +} substrait_Expression_Subquery_InPredicate; + +typedef struct _substrait_Expression_Subquery_Scalar { + struct _substrait_Rel *input; +} substrait_Expression_Subquery_Scalar; + +typedef struct _substrait_Expression_Subquery_SetComparison { + substrait_Expression_Subquery_SetComparison_ReductionOp *reduction_op; + substrait_Expression_Subquery_SetComparison_ComparisonOp *comparison_op; + struct _substrait_Expression *left; + struct _substrait_Rel *right; +} substrait_Expression_Subquery_SetComparison; + +typedef struct _substrait_Expression_Subquery_SetPredicate { + substrait_Expression_Subquery_SetPredicate_PredicateOp *predicate_op; + struct _substrait_Rel *tuples; +} substrait_Expression_Subquery_SetPredicate; + +typedef struct _substrait_Expression_SwitchExpression { + pb_size_t ifs_count; + struct _substrait_Expression_SwitchExpression_IfValue *ifs; + struct _substrait_Expression *else_; + struct _substrait_Expression *match; +} substrait_Expression_SwitchExpression; + +typedef struct _substrait_Expression_SwitchExpression_IfValue { + struct _substrait_Expression_Literal *if_; + struct _substrait_Expression *then; +} substrait_Expression_SwitchExpression_IfValue; + +typedef struct _substrait_Expression_WindowFunction { + uint32_t *function_reference; + pb_size_t partitions_count; + struct _substrait_Expression *partitions; + pb_size_t sorts_count; + struct _substrait_SortField *sorts; + struct _substrait_Expression_WindowFunction_Bound *upper_bound; + struct _substrait_Expression_WindowFunction_Bound *lower_bound; + substrait_AggregationPhase *phase; + struct _substrait_Type *output_type; + pb_size_t args_count; + struct _substrait_Expression *args; + pb_size_t arguments_count; + struct _substrait_FunctionArgument *arguments; +} substrait_Expression_WindowFunction; + +typedef struct _substrait_Expression_WindowFunction_Bound { + pb_size_t which_kind; + union { + struct _substrait_Expression_WindowFunction_Bound_Preceding *preceding; + struct _substrait_Expression_WindowFunction_Bound_Following *following; + struct _substrait_Expression_WindowFunction_Bound_CurrentRow *current_row; + struct _substrait_Expression_WindowFunction_Bound_Unbounded *unbounded; + } kind; +} substrait_Expression_WindowFunction_Bound; + +typedef struct _substrait_Expression_WindowFunction_Bound_CurrentRow { + char dummy_field; +} substrait_Expression_WindowFunction_Bound_CurrentRow; + +typedef struct _substrait_Expression_WindowFunction_Bound_Following { + int64_t *offset; +} substrait_Expression_WindowFunction_Bound_Following; + +typedef struct _substrait_Expression_WindowFunction_Bound_Preceding { + int64_t *offset; +} substrait_Expression_WindowFunction_Bound_Preceding; + +typedef struct _substrait_Expression_WindowFunction_Bound_Unbounded { + char dummy_field; +} substrait_Expression_WindowFunction_Bound_Unbounded; + +typedef struct _substrait_ExtensionLeafRel { + struct _substrait_RelCommon *common; + struct _substrait_Any *detail; +} substrait_ExtensionLeafRel; + +typedef struct _substrait_ExtensionMultiRel { + struct _substrait_RelCommon *common; + pb_size_t inputs_count; + struct _substrait_Rel *inputs; + struct _substrait_Any *detail; +} substrait_ExtensionMultiRel; + +typedef struct _substrait_ExtensionSingleRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + struct _substrait_Any *detail; +} substrait_ExtensionSingleRel; + +/* The description of a field to sort on (including the direction of sorting and null semantics) */ +typedef struct _substrait_FetchRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + int64_t *offset; + int64_t *count; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_FetchRel; + +typedef struct _substrait_FilterRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + struct _substrait_Expression *condition; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_FilterRel; + +typedef struct _substrait_FunctionArgument { + pb_size_t which_arg_type; + union { + struct _substrait_FunctionArgument_Enum *enum_; + struct _substrait_Type *type; + struct _substrait_Expression *value; + } arg_type; +} substrait_FunctionArgument; + +typedef struct _substrait_FunctionArgument_Enum { + pb_size_t which_enum_kind; + union { + char *specified; + struct _substrait_Any *unspecified; + } enum_kind; +} substrait_FunctionArgument_Enum; + +/* The argument of a function */ +typedef struct _substrait_JoinRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *left; + struct _substrait_Rel *right; + struct _substrait_Expression *expression; + struct _substrait_Expression *post_join_filter; + substrait_JoinRel_JoinType *type; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_JoinRel; + +/* A relation (used internally in a plan) */ +typedef struct _substrait_ProjectRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + pb_size_t expressions_count; + struct _substrait_Expression *expressions; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_ProjectRel; + +/* The relational operator representing a GROUP BY Aggregate */ +typedef struct _substrait_ReadRel { + struct _substrait_RelCommon *common; + /* Input of the aggregation */ + struct _substrait_NamedStruct *base_schema; + /* A list of expression grouping that the aggregation measured should be calculated for. */ + struct _substrait_Expression *filter; + /* A list of one or more aggregate expressions along with an optional filter. */ + struct _substrait_Expression_MaskExpression *projection; + pb_size_t which_read_type; + union { + struct _substrait_ReadRel_VirtualTable *virtual_table; + struct _substrait_ReadRel_LocalFiles *local_files; + struct _substrait_ReadRel_NamedTable *named_table; + struct _substrait_ReadRel_ExtensionTable *extension_table; + } read_type; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_ReadRel; + +/* The relational set operators (intersection/union/etc..) */ +typedef struct _substrait_ReadRel_ExtensionTable { + struct _substrait_Any *detail; +} substrait_ReadRel_ExtensionTable; + +/* Stub to support extension with a single input */ +typedef struct _substrait_ReadRel_LocalFiles { + pb_size_t items_count; + struct _substrait_ReadRel_LocalFiles_FileOrFiles *items; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_ReadRel_LocalFiles; + +/* Stub to support extension with a zero inputs */ +typedef struct _substrait_ReadRel_LocalFiles_FileOrFiles { + pb_size_t which_path_type; + union { + char *uri_path; + char *uri_path_glob; + char *uri_file; + char *uri_folder; + } path_type; + uint64_t *partition_index; + uint64_t *start; + uint64_t *length; + pb_size_t which_file_format; + union { + struct _substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions *parquet; + struct _substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions *arrow; + struct _substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions *orc; + struct _substrait_Any *extension; + } file_format; +} substrait_ReadRel_LocalFiles_FileOrFiles; + +/* A redistribution operation */ +typedef struct _substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions { + char dummy_field; +} substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions; + +/* A relation with output field names. + + This is for use at the root of a `Rel` tree. */ +typedef struct _substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions { + char dummy_field; +} substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions; + +/* Stub to support extension with multiple inputs */ +typedef struct _substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions { + char dummy_field; +} substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions; + +/* The ORDERY BY (or sorting) relational operator. Beside describing a base relation, it includes a list of fields to sort on */ +typedef struct _substrait_ReadRel_NamedTable { + pb_size_t names_count; + char **names; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_ReadRel_NamedTable; + +/* The relational operator capturing simple FILTERs (as in the WHERE clause of SQL) */ +typedef struct _substrait_ReadRel_VirtualTable { + pb_size_t values_count; + struct _substrait_Expression_Literal_Struct *values; +} substrait_ReadRel_VirtualTable; + +typedef struct _substrait_Rel { + pb_size_t which_rel_type; + union { + struct _substrait_ReadRel *read; + struct _substrait_FilterRel *filter; + struct _substrait_FetchRel *fetch; + struct _substrait_AggregateRel *aggregate; + struct _substrait_SortRel *sort; + struct _substrait_JoinRel *join; + struct _substrait_ProjectRel *project; + struct _substrait_SetRel *set; + struct _substrait_ExtensionSingleRel *extension_single; + struct _substrait_ExtensionMultiRel *extension_multi; + struct _substrait_ExtensionLeafRel *extension_leaf; + struct _substrait_CrossRel *cross; + } rel_type; +} substrait_Rel; + +/* Common fields for all relational operators */ +typedef struct _substrait_RelCommon { + pb_size_t which_emit_kind; + union { + /* The underlying relation is output as is (no reordering or projection of columns) */ + struct _substrait_RelCommon_Direct *direct; + /* Allows to control for order and inclusion of fields */ + struct _substrait_RelCommon_Emit *emit; + } emit_kind; + struct _substrait_RelCommon_Hint *hint; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_RelCommon; + +/* The scan operator of base data (physical or virtual), including filtering and projection. */ +typedef struct _substrait_RelCommon_Direct { + char dummy_field; +} substrait_RelCommon_Direct; + +/* This operator allows to represent calculated expressions of fields (e.g., a+b). Direct/Emit are used to represent classical relational projections */ +typedef struct _substrait_RelCommon_Emit { + pb_size_t output_mapping_count; + int32_t *output_mapping; +} substrait_RelCommon_Emit; + +/* The binary JOIN relational operator left-join-right, including various join types, a join condition and post_join_filter expression */ +typedef struct _substrait_RelCommon_Hint { + struct _substrait_RelCommon_Hint_Stats *stats; + struct _substrait_RelCommon_Hint_RuntimeConstraint *constraint; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_RelCommon_Hint; + +/* The relational operator representing LIMIT/OFFSET or TOP type semantics. */ +typedef struct _substrait_RelCommon_Hint_RuntimeConstraint { + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_RelCommon_Hint_RuntimeConstraint; + +/* Cartesian product relational operator of two tables (left and right) */ +typedef struct _substrait_RelCommon_Hint_Stats { + double *row_count; + double *record_size; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_RelCommon_Hint_Stats; + +typedef struct _substrait_RelRoot { + struct _substrait_Rel *input; + pb_size_t names_count; + char **names; +} substrait_RelRoot; + +typedef struct _substrait_SetRel { + struct _substrait_RelCommon *common; + pb_size_t inputs_count; + struct _substrait_Rel *inputs; + substrait_SetRel_SetOp *op; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_SetRel; + +typedef struct _substrait_SortField { + struct _substrait_Expression *expr; + pb_size_t which_sort_kind; + union { + substrait_SortField_SortDirection *direction; + uint32_t *comparison_function_reference; + } sort_kind; +} substrait_SortField; + +typedef struct _substrait_SortRel { + struct _substrait_RelCommon *common; + struct _substrait_Rel *input; + pb_size_t sorts_count; + struct _substrait_SortField *sorts; + struct _substrait_extensions_AdvancedExtension *advanced_extension; +} substrait_SortRel; + + +/* Helper constants for enums */ +#define _substrait_AggregationPhase_MIN substrait_AggregationPhase_AGGREGATION_PHASE_UNSPECIFIED +#define _substrait_AggregationPhase_MAX substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT +#define _substrait_AggregationPhase_ARRAYSIZE ((substrait_AggregationPhase)(substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT+1)) + +#define _substrait_JoinRel_JoinType_MIN substrait_JoinRel_JoinType_JOIN_TYPE_UNSPECIFIED +#define _substrait_JoinRel_JoinType_MAX substrait_JoinRel_JoinType_JOIN_TYPE_SINGLE +#define _substrait_JoinRel_JoinType_ARRAYSIZE ((substrait_JoinRel_JoinType)(substrait_JoinRel_JoinType_JOIN_TYPE_SINGLE+1)) + +#define _substrait_SetRel_SetOp_MIN substrait_SetRel_SetOp_SET_OP_UNSPECIFIED +#define _substrait_SetRel_SetOp_MAX substrait_SetRel_SetOp_SET_OP_UNION_ALL +#define _substrait_SetRel_SetOp_ARRAYSIZE ((substrait_SetRel_SetOp)(substrait_SetRel_SetOp_SET_OP_UNION_ALL+1)) + +#define _substrait_Expression_Cast_FailureBehavior_MIN substrait_Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_UNSPECIFIED +#define _substrait_Expression_Cast_FailureBehavior_MAX substrait_Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_THROW_EXCEPTION +#define _substrait_Expression_Cast_FailureBehavior_ARRAYSIZE ((substrait_Expression_Cast_FailureBehavior)(substrait_Expression_Cast_FailureBehavior_FAILURE_BEHAVIOR_THROW_EXCEPTION+1)) + +#define _substrait_Expression_Subquery_SetPredicate_PredicateOp_MIN substrait_Expression_Subquery_SetPredicate_PredicateOp_PREDICATE_OP_UNSPECIFIED +#define _substrait_Expression_Subquery_SetPredicate_PredicateOp_MAX substrait_Expression_Subquery_SetPredicate_PredicateOp_PREDICATE_OP_UNIQUE +#define _substrait_Expression_Subquery_SetPredicate_PredicateOp_ARRAYSIZE ((substrait_Expression_Subquery_SetPredicate_PredicateOp)(substrait_Expression_Subquery_SetPredicate_PredicateOp_PREDICATE_OP_UNIQUE+1)) + +#define _substrait_Expression_Subquery_SetComparison_ComparisonOp_MIN substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_UNSPECIFIED +#define _substrait_Expression_Subquery_SetComparison_ComparisonOp_MAX substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_GE +#define _substrait_Expression_Subquery_SetComparison_ComparisonOp_ARRAYSIZE ((substrait_Expression_Subquery_SetComparison_ComparisonOp)(substrait_Expression_Subquery_SetComparison_ComparisonOp_COMPARISON_OP_GE+1)) + +#define _substrait_Expression_Subquery_SetComparison_ReductionOp_MIN substrait_Expression_Subquery_SetComparison_ReductionOp_REDUCTION_OP_UNSPECIFIED +#define _substrait_Expression_Subquery_SetComparison_ReductionOp_MAX substrait_Expression_Subquery_SetComparison_ReductionOp_REDUCTION_OP_ALL +#define _substrait_Expression_Subquery_SetComparison_ReductionOp_ARRAYSIZE ((substrait_Expression_Subquery_SetComparison_ReductionOp)(substrait_Expression_Subquery_SetComparison_ReductionOp_REDUCTION_OP_ALL+1)) + +#define _substrait_SortField_SortDirection_MIN substrait_SortField_SortDirection_SORT_DIRECTION_UNSPECIFIED +#define _substrait_SortField_SortDirection_MAX substrait_SortField_SortDirection_SORT_DIRECTION_CLUSTERED +#define _substrait_SortField_SortDirection_ARRAYSIZE ((substrait_SortField_SortDirection)(substrait_SortField_SortDirection_SORT_DIRECTION_CLUSTERED+1)) + +#define _substrait_AggregateFunction_AggregationInvocation_MIN substrait_AggregateFunction_AggregationInvocation_AGGREGATION_INVOCATION_UNSPECIFIED +#define _substrait_AggregateFunction_AggregationInvocation_MAX substrait_AggregateFunction_AggregationInvocation_AGGREGATION_INVOCATION_DISTINCT +#define _substrait_AggregateFunction_AggregationInvocation_ARRAYSIZE ((substrait_AggregateFunction_AggregationInvocation)(substrait_AggregateFunction_AggregationInvocation_AGGREGATION_INVOCATION_DISTINCT+1)) + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define substrait_RelCommon_init_default {0, {NULL}, NULL, NULL} +#define substrait_RelCommon_Direct_init_default {0} +#define substrait_RelCommon_Emit_init_default {0, NULL} +#define substrait_RelCommon_Hint_init_default {NULL, NULL, NULL} +#define substrait_RelCommon_Hint_Stats_init_default {NULL, NULL, NULL} +#define substrait_RelCommon_Hint_RuntimeConstraint_init_default {NULL} +#define substrait_ReadRel_init_default {NULL, NULL, NULL, NULL, 0, {NULL}, NULL} +#define substrait_ReadRel_NamedTable_init_default {0, NULL, NULL} +#define substrait_ReadRel_VirtualTable_init_default {0, NULL} +#define substrait_ReadRel_ExtensionTable_init_default {NULL} +#define substrait_ReadRel_LocalFiles_init_default {0, NULL, NULL} +#define substrait_ReadRel_LocalFiles_FileOrFiles_init_default {0, {NULL}, NULL, NULL, NULL, 0, {NULL}} +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_init_default {0} +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_init_default {0} +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_init_default {0} +#define substrait_ProjectRel_init_default {NULL, NULL, 0, NULL, NULL} +#define substrait_JoinRel_init_default {NULL, NULL, NULL, NULL, NULL, NULL, NULL} +#define substrait_CrossRel_init_default {NULL, NULL, NULL, NULL} +#define substrait_FetchRel_init_default {NULL, NULL, NULL, NULL, NULL} +#define substrait_AggregateRel_init_default {NULL, NULL, 0, NULL, 0, NULL, NULL} +#define substrait_AggregateRel_Grouping_init_default {0, NULL} +#define substrait_AggregateRel_Measure_init_default {NULL, NULL} +#define substrait_SortRel_init_default {NULL, NULL, 0, NULL, NULL} +#define substrait_FilterRel_init_default {NULL, NULL, NULL, NULL} +#define substrait_SetRel_init_default {NULL, 0, NULL, NULL, NULL} +#define substrait_ExtensionSingleRel_init_default {NULL, NULL, NULL} +#define substrait_ExtensionLeafRel_init_default {NULL, NULL} +#define substrait_ExtensionMultiRel_init_default {NULL, 0, NULL, NULL} +#define substrait_ExchangeRel_init_default {NULL, NULL, NULL, 0, NULL, 0, {NULL}, NULL} +#define substrait_ExchangeRel_ScatterFields_init_default {0, NULL} +#define substrait_ExchangeRel_SingleBucketExpression_init_default {NULL} +#define substrait_ExchangeRel_MultiBucketExpression_init_default {NULL, NULL} +#define substrait_ExchangeRel_Broadcast_init_default {0} +#define substrait_ExchangeRel_RoundRobin_init_default {NULL} +#define substrait_ExchangeRel_ExchangeTarget_init_default {0, NULL, 0, {NULL}} +#define substrait_RelRoot_init_default {NULL, 0, NULL} +#define substrait_Rel_init_default {0, {NULL}} +#define substrait_FunctionArgument_init_default {0, {NULL}} +#define substrait_FunctionArgument_Enum_init_default {0, {NULL}} +#define substrait_Expression_init_default {0, {NULL}} +#define substrait_Expression_Enum_init_default {0, {NULL}} +#define substrait_Expression_Enum_Empty_init_default {0} +#define substrait_Expression_Literal_init_default {0, {NULL}, NULL, NULL} +#define substrait_Expression_Literal_VarChar_init_default {NULL, NULL} +#define substrait_Expression_Literal_Decimal_init_default {NULL, NULL, NULL} +#define substrait_Expression_Literal_Map_init_default {0, NULL} +#define substrait_Expression_Literal_Map_KeyValue_init_default {NULL, NULL} +#define substrait_Expression_Literal_IntervalYearToMonth_init_default {NULL, NULL} +#define substrait_Expression_Literal_IntervalDayToSecond_init_default {NULL, NULL, NULL} +#define substrait_Expression_Literal_Struct_init_default {0, NULL} +#define substrait_Expression_Literal_List_init_default {0, NULL} +#define substrait_Expression_Literal_UserDefined_init_default {NULL, NULL} +#define substrait_Expression_ScalarFunction_init_default {NULL, 0, NULL, NULL, 0, NULL} +#define substrait_Expression_WindowFunction_init_default {NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL} +#define substrait_Expression_WindowFunction_Bound_init_default {0, {NULL}} +#define substrait_Expression_WindowFunction_Bound_Preceding_init_default {NULL} +#define substrait_Expression_WindowFunction_Bound_Following_init_default {NULL} +#define substrait_Expression_WindowFunction_Bound_CurrentRow_init_default {0} +#define substrait_Expression_WindowFunction_Bound_Unbounded_init_default {0} +#define substrait_Expression_IfThen_init_default {0, NULL, NULL} +#define substrait_Expression_IfThen_IfClause_init_default {NULL, NULL} +#define substrait_Expression_Cast_init_default {NULL, NULL, NULL} +#define substrait_Expression_SwitchExpression_init_default {0, NULL, NULL, NULL} +#define substrait_Expression_SwitchExpression_IfValue_init_default {NULL, NULL} +#define substrait_Expression_SingularOrList_init_default {NULL, 0, NULL} +#define substrait_Expression_MultiOrList_init_default {0, NULL, 0, NULL} +#define substrait_Expression_MultiOrList_Record_init_default {0, NULL} +#define substrait_Expression_EmbeddedFunction_init_default {0, NULL, NULL, 0, {NULL}} +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_init_default {NULL, 0, NULL} +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_init_default {NULL, 0, NULL} +#define substrait_Expression_ReferenceSegment_init_default {0, {NULL}} +#define substrait_Expression_ReferenceSegment_MapKey_init_default {NULL, NULL} +#define substrait_Expression_ReferenceSegment_StructField_init_default {NULL, NULL} +#define substrait_Expression_ReferenceSegment_ListElement_init_default {NULL, NULL} +#define substrait_Expression_MaskExpression_init_default {NULL, NULL} +#define substrait_Expression_MaskExpression_Select_init_default {0, {NULL}} +#define substrait_Expression_MaskExpression_StructSelect_init_default {0, NULL} +#define substrait_Expression_MaskExpression_StructItem_init_default {NULL, NULL} +#define substrait_Expression_MaskExpression_ListSelect_init_default {0, NULL, NULL} +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_init_default {0, {NULL}} +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_init_default {NULL} +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_init_default {NULL, NULL} +#define substrait_Expression_MaskExpression_MapSelect_init_default {0, {NULL}, NULL} +#define substrait_Expression_MaskExpression_MapSelect_MapKey_init_default {NULL} +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_init_default {NULL} +#define substrait_Expression_FieldReference_init_default {0, {NULL}, 0, {NULL}} +#define substrait_Expression_FieldReference_RootReference_init_default {0} +#define substrait_Expression_FieldReference_OuterReference_init_default {NULL} +#define substrait_Expression_Subquery_init_default {0, {NULL}} +#define substrait_Expression_Subquery_Scalar_init_default {NULL} +#define substrait_Expression_Subquery_InPredicate_init_default {0, NULL, NULL} +#define substrait_Expression_Subquery_SetPredicate_init_default {NULL, NULL} +#define substrait_Expression_Subquery_SetComparison_init_default {NULL, NULL, NULL, NULL} +#define substrait_SortField_init_default {NULL, 0, {NULL}} +#define substrait_AggregateFunction_init_default {NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL} +#define substrait_RelCommon_init_zero {0, {NULL}, NULL, NULL} +#define substrait_RelCommon_Direct_init_zero {0} +#define substrait_RelCommon_Emit_init_zero {0, NULL} +#define substrait_RelCommon_Hint_init_zero {NULL, NULL, NULL} +#define substrait_RelCommon_Hint_Stats_init_zero {NULL, NULL, NULL} +#define substrait_RelCommon_Hint_RuntimeConstraint_init_zero {NULL} +#define substrait_ReadRel_init_zero {NULL, NULL, NULL, NULL, 0, {NULL}, NULL} +#define substrait_ReadRel_NamedTable_init_zero {0, NULL, NULL} +#define substrait_ReadRel_VirtualTable_init_zero {0, NULL} +#define substrait_ReadRel_ExtensionTable_init_zero {NULL} +#define substrait_ReadRel_LocalFiles_init_zero {0, NULL, NULL} +#define substrait_ReadRel_LocalFiles_FileOrFiles_init_zero {0, {NULL}, NULL, NULL, NULL, 0, {NULL}} +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_init_zero {0} +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_init_zero {0} +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_init_zero {0} +#define substrait_ProjectRel_init_zero {NULL, NULL, 0, NULL, NULL} +#define substrait_JoinRel_init_zero {NULL, NULL, NULL, NULL, NULL, NULL, NULL} +#define substrait_CrossRel_init_zero {NULL, NULL, NULL, NULL} +#define substrait_FetchRel_init_zero {NULL, NULL, NULL, NULL, NULL} +#define substrait_AggregateRel_init_zero {NULL, NULL, 0, NULL, 0, NULL, NULL} +#define substrait_AggregateRel_Grouping_init_zero {0, NULL} +#define substrait_AggregateRel_Measure_init_zero {NULL, NULL} +#define substrait_SortRel_init_zero {NULL, NULL, 0, NULL, NULL} +#define substrait_FilterRel_init_zero {NULL, NULL, NULL, NULL} +#define substrait_SetRel_init_zero {NULL, 0, NULL, NULL, NULL} +#define substrait_ExtensionSingleRel_init_zero {NULL, NULL, NULL} +#define substrait_ExtensionLeafRel_init_zero {NULL, NULL} +#define substrait_ExtensionMultiRel_init_zero {NULL, 0, NULL, NULL} +#define substrait_ExchangeRel_init_zero {NULL, NULL, NULL, 0, NULL, 0, {NULL}, NULL} +#define substrait_ExchangeRel_ScatterFields_init_zero {0, NULL} +#define substrait_ExchangeRel_SingleBucketExpression_init_zero {NULL} +#define substrait_ExchangeRel_MultiBucketExpression_init_zero {NULL, NULL} +#define substrait_ExchangeRel_Broadcast_init_zero {0} +#define substrait_ExchangeRel_RoundRobin_init_zero {NULL} +#define substrait_ExchangeRel_ExchangeTarget_init_zero {0, NULL, 0, {NULL}} +#define substrait_RelRoot_init_zero {NULL, 0, NULL} +#define substrait_Rel_init_zero {0, {NULL}} +#define substrait_FunctionArgument_init_zero {0, {NULL}} +#define substrait_FunctionArgument_Enum_init_zero {0, {NULL}} +#define substrait_Expression_init_zero {0, {NULL}} +#define substrait_Expression_Enum_init_zero {0, {NULL}} +#define substrait_Expression_Enum_Empty_init_zero {0} +#define substrait_Expression_Literal_init_zero {0, {NULL}, NULL, NULL} +#define substrait_Expression_Literal_VarChar_init_zero {NULL, NULL} +#define substrait_Expression_Literal_Decimal_init_zero {NULL, NULL, NULL} +#define substrait_Expression_Literal_Map_init_zero {0, NULL} +#define substrait_Expression_Literal_Map_KeyValue_init_zero {NULL, NULL} +#define substrait_Expression_Literal_IntervalYearToMonth_init_zero {NULL, NULL} +#define substrait_Expression_Literal_IntervalDayToSecond_init_zero {NULL, NULL, NULL} +#define substrait_Expression_Literal_Struct_init_zero {0, NULL} +#define substrait_Expression_Literal_List_init_zero {0, NULL} +#define substrait_Expression_Literal_UserDefined_init_zero {NULL, NULL} +#define substrait_Expression_ScalarFunction_init_zero {NULL, 0, NULL, NULL, 0, NULL} +#define substrait_Expression_WindowFunction_init_zero {NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL} +#define substrait_Expression_WindowFunction_Bound_init_zero {0, {NULL}} +#define substrait_Expression_WindowFunction_Bound_Preceding_init_zero {NULL} +#define substrait_Expression_WindowFunction_Bound_Following_init_zero {NULL} +#define substrait_Expression_WindowFunction_Bound_CurrentRow_init_zero {0} +#define substrait_Expression_WindowFunction_Bound_Unbounded_init_zero {0} +#define substrait_Expression_IfThen_init_zero {0, NULL, NULL} +#define substrait_Expression_IfThen_IfClause_init_zero {NULL, NULL} +#define substrait_Expression_Cast_init_zero {NULL, NULL, NULL} +#define substrait_Expression_SwitchExpression_init_zero {0, NULL, NULL, NULL} +#define substrait_Expression_SwitchExpression_IfValue_init_zero {NULL, NULL} +#define substrait_Expression_SingularOrList_init_zero {NULL, 0, NULL} +#define substrait_Expression_MultiOrList_init_zero {0, NULL, 0, NULL} +#define substrait_Expression_MultiOrList_Record_init_zero {0, NULL} +#define substrait_Expression_EmbeddedFunction_init_zero {0, NULL, NULL, 0, {NULL}} +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_init_zero {NULL, 0, NULL} +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_init_zero {NULL, 0, NULL} +#define substrait_Expression_ReferenceSegment_init_zero {0, {NULL}} +#define substrait_Expression_ReferenceSegment_MapKey_init_zero {NULL, NULL} +#define substrait_Expression_ReferenceSegment_StructField_init_zero {NULL, NULL} +#define substrait_Expression_ReferenceSegment_ListElement_init_zero {NULL, NULL} +#define substrait_Expression_MaskExpression_init_zero {NULL, NULL} +#define substrait_Expression_MaskExpression_Select_init_zero {0, {NULL}} +#define substrait_Expression_MaskExpression_StructSelect_init_zero {0, NULL} +#define substrait_Expression_MaskExpression_StructItem_init_zero {NULL, NULL} +#define substrait_Expression_MaskExpression_ListSelect_init_zero {0, NULL, NULL} +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_init_zero {0, {NULL}} +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_init_zero {NULL} +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_init_zero {NULL, NULL} +#define substrait_Expression_MaskExpression_MapSelect_init_zero {0, {NULL}, NULL} +#define substrait_Expression_MaskExpression_MapSelect_MapKey_init_zero {NULL} +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_init_zero {NULL} +#define substrait_Expression_FieldReference_init_zero {0, {NULL}, 0, {NULL}} +#define substrait_Expression_FieldReference_RootReference_init_zero {0} +#define substrait_Expression_FieldReference_OuterReference_init_zero {NULL} +#define substrait_Expression_Subquery_init_zero {0, {NULL}} +#define substrait_Expression_Subquery_Scalar_init_zero {NULL} +#define substrait_Expression_Subquery_InPredicate_init_zero {0, NULL, NULL} +#define substrait_Expression_Subquery_SetPredicate_init_zero {NULL, NULL} +#define substrait_Expression_Subquery_SetComparison_init_zero {NULL, NULL, NULL, NULL} +#define substrait_SortField_init_zero {NULL, 0, {NULL}} +#define substrait_AggregateFunction_init_zero {NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define substrait_AggregateFunction_function_reference_tag 1 +#define substrait_AggregateFunction_args_tag 2 +#define substrait_AggregateFunction_sorts_tag 3 +#define substrait_AggregateFunction_phase_tag 4 +#define substrait_AggregateFunction_output_type_tag 5 +#define substrait_AggregateFunction_invocation_tag 6 +#define substrait_AggregateFunction_arguments_tag 7 +#define substrait_AggregateRel_common_tag 1 +#define substrait_AggregateRel_input_tag 2 +#define substrait_AggregateRel_groupings_tag 3 +#define substrait_AggregateRel_measures_tag 4 +#define substrait_AggregateRel_advanced_extension_tag 10 +#define substrait_AggregateRel_Grouping_grouping_expressions_tag 1 +#define substrait_AggregateRel_Measure_measure_tag 1 +#define substrait_AggregateRel_Measure_filter_tag 2 +#define substrait_CrossRel_common_tag 1 +#define substrait_CrossRel_left_tag 2 +#define substrait_CrossRel_right_tag 3 +#define substrait_CrossRel_advanced_extension_tag 10 +#define substrait_ExchangeRel_common_tag 1 +#define substrait_ExchangeRel_input_tag 2 +#define substrait_ExchangeRel_partition_count_tag 3 +#define substrait_ExchangeRel_targets_tag 4 +#define substrait_ExchangeRel_scatter_by_fields_tag 5 +#define substrait_ExchangeRel_single_target_tag 6 +#define substrait_ExchangeRel_multi_target_tag 7 +#define substrait_ExchangeRel_round_robin_tag 8 +#define substrait_ExchangeRel_broadcast_tag 9 +#define substrait_ExchangeRel_advanced_extension_tag 10 +#define substrait_ExchangeRel_ExchangeTarget_partition_id_tag 1 +#define substrait_ExchangeRel_ExchangeTarget_uri_tag 2 +#define substrait_ExchangeRel_ExchangeTarget_extended_tag 3 +#define substrait_ExchangeRel_MultiBucketExpression_expression_tag 1 +#define substrait_ExchangeRel_MultiBucketExpression_constrained_to_count_tag 2 +#define substrait_ExchangeRel_RoundRobin_exact_tag 1 +#define substrait_ExchangeRel_ScatterFields_fields_tag 1 +#define substrait_ExchangeRel_SingleBucketExpression_expression_tag 1 +#define substrait_Expression_literal_tag 1 +#define substrait_Expression_selection_tag 2 +#define substrait_Expression_scalar_function_tag 3 +#define substrait_Expression_window_function_tag 5 +#define substrait_Expression_if_then_tag 6 +#define substrait_Expression_switch_expression_tag 7 +#define substrait_Expression_singular_or_list_tag 8 +#define substrait_Expression_multi_or_list_tag 9 +#define substrait_Expression_enum__tag 10 +#define substrait_Expression_cast_tag 11 +#define substrait_Expression_subquery_tag 12 +#define substrait_Expression_Cast_type_tag 1 +#define substrait_Expression_Cast_input_tag 2 +#define substrait_Expression_Cast_failure_behavior_tag 3 +#define substrait_Expression_EmbeddedFunction_arguments_tag 1 +#define substrait_Expression_EmbeddedFunction_output_type_tag 2 +#define substrait_Expression_EmbeddedFunction_python_pickle_function_tag 3 +#define substrait_Expression_EmbeddedFunction_web_assembly_function_tag 4 +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_function__tag 1 +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_prerequisite_tag 2 +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_script_tag 1 +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_prerequisite_tag 2 +#define substrait_Expression_Enum_specified_tag 1 +#define substrait_Expression_Enum_unspecified_tag 2 +#define substrait_Expression_FieldReference_direct_reference_tag 1 +#define substrait_Expression_FieldReference_masked_reference_tag 2 +#define substrait_Expression_FieldReference_expression_tag 3 +#define substrait_Expression_FieldReference_root_reference_tag 4 +#define substrait_Expression_FieldReference_outer_reference_tag 5 +#define substrait_Expression_FieldReference_OuterReference_steps_out_tag 1 +#define substrait_Expression_IfThen_ifs_tag 1 +#define substrait_Expression_IfThen_else__tag 2 +#define substrait_Expression_IfThen_IfClause_if__tag 1 +#define substrait_Expression_IfThen_IfClause_then_tag 2 +#define substrait_Expression_Literal_boolean_tag 1 +#define substrait_Expression_Literal_i8_tag 2 +#define substrait_Expression_Literal_i16_tag 3 +#define substrait_Expression_Literal_i32_tag 5 +#define substrait_Expression_Literal_i64_tag 7 +#define substrait_Expression_Literal_fp32_tag 10 +#define substrait_Expression_Literal_fp64_tag 11 +#define substrait_Expression_Literal_string_tag 12 +#define substrait_Expression_Literal_binary_tag 13 +#define substrait_Expression_Literal_timestamp_tag 14 +#define substrait_Expression_Literal_date_tag 16 +#define substrait_Expression_Literal_time_tag 17 +#define substrait_Expression_Literal_interval_year_to_month_tag 19 +#define substrait_Expression_Literal_interval_day_to_second_tag 20 +#define substrait_Expression_Literal_fixed_char_tag 21 +#define substrait_Expression_Literal_var_char_tag 22 +#define substrait_Expression_Literal_fixed_binary_tag 23 +#define substrait_Expression_Literal_decimal_tag 24 +#define substrait_Expression_Literal_struct__tag 25 +#define substrait_Expression_Literal_map_tag 26 +#define substrait_Expression_Literal_timestamp_tz_tag 27 +#define substrait_Expression_Literal_uuid_tag 28 +#define substrait_Expression_Literal_null_tag 29 +#define substrait_Expression_Literal_list_tag 30 +#define substrait_Expression_Literal_empty_list_tag 31 +#define substrait_Expression_Literal_empty_map_tag 32 +#define substrait_Expression_Literal_user_defined_tag 33 +#define substrait_Expression_Literal_nullable_tag 50 +#define substrait_Expression_Literal_type_variation_reference_tag 51 +#define substrait_Expression_Literal_Decimal_value_tag 1 +#define substrait_Expression_Literal_Decimal_precision_tag 2 +#define substrait_Expression_Literal_Decimal_scale_tag 3 +#define substrait_Expression_Literal_IntervalDayToSecond_days_tag 1 +#define substrait_Expression_Literal_IntervalDayToSecond_seconds_tag 2 +#define substrait_Expression_Literal_IntervalDayToSecond_microseconds_tag 3 +#define substrait_Expression_Literal_IntervalYearToMonth_years_tag 1 +#define substrait_Expression_Literal_IntervalYearToMonth_months_tag 2 +#define substrait_Expression_Literal_List_values_tag 1 +#define substrait_Expression_Literal_Map_key_values_tag 1 +#define substrait_Expression_Literal_Map_KeyValue_key_tag 1 +#define substrait_Expression_Literal_Map_KeyValue_value_tag 2 +#define substrait_Expression_Literal_Struct_fields_tag 1 +#define substrait_Expression_Literal_UserDefined_type_reference_tag 1 +#define substrait_Expression_Literal_UserDefined_value_tag 2 +#define substrait_Expression_Literal_VarChar_value_tag 1 +#define substrait_Expression_Literal_VarChar_length_tag 2 +#define substrait_Expression_MaskExpression_select_tag 1 +#define substrait_Expression_MaskExpression_maintain_singular_struct__tag 2 +#define substrait_Expression_MaskExpression_ListSelect_selection_tag 1 +#define substrait_Expression_MaskExpression_ListSelect_child_tag 2 +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_item_tag 1 +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_slice_tag 2 +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_field_tag 1 +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_start_tag 1 +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_end_tag 2 +#define substrait_Expression_MaskExpression_MapSelect_key_tag 1 +#define substrait_Expression_MaskExpression_MapSelect_expression_tag 2 +#define substrait_Expression_MaskExpression_MapSelect_child_tag 3 +#define substrait_Expression_MaskExpression_MapSelect_MapKey_map_key_tag 1 +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_map_key_expression_tag 1 +#define substrait_Expression_MaskExpression_Select_struct__tag 1 +#define substrait_Expression_MaskExpression_Select_list_tag 2 +#define substrait_Expression_MaskExpression_Select_map_tag 3 +#define substrait_Expression_MaskExpression_StructItem_field_tag 1 +#define substrait_Expression_MaskExpression_StructItem_child_tag 2 +#define substrait_Expression_MaskExpression_StructSelect_struct_items_tag 1 +#define substrait_Expression_MultiOrList_value_tag 1 +#define substrait_Expression_MultiOrList_options_tag 2 +#define substrait_Expression_MultiOrList_Record_fields_tag 1 +#define substrait_Expression_ReferenceSegment_map_key_tag 1 +#define substrait_Expression_ReferenceSegment_struct_field_tag 2 +#define substrait_Expression_ReferenceSegment_list_element_tag 3 +#define substrait_Expression_ReferenceSegment_ListElement_offset_tag 1 +#define substrait_Expression_ReferenceSegment_ListElement_child_tag 2 +#define substrait_Expression_ReferenceSegment_MapKey_map_key_tag 1 +#define substrait_Expression_ReferenceSegment_MapKey_child_tag 2 +#define substrait_Expression_ReferenceSegment_StructField_field_tag 1 +#define substrait_Expression_ReferenceSegment_StructField_child_tag 2 +#define substrait_Expression_ScalarFunction_function_reference_tag 1 +#define substrait_Expression_ScalarFunction_args_tag 2 +#define substrait_Expression_ScalarFunction_output_type_tag 3 +#define substrait_Expression_ScalarFunction_arguments_tag 4 +#define substrait_Expression_SingularOrList_value_tag 1 +#define substrait_Expression_SingularOrList_options_tag 2 +#define substrait_Expression_Subquery_scalar_tag 1 +#define substrait_Expression_Subquery_in_predicate_tag 2 +#define substrait_Expression_Subquery_set_predicate_tag 3 +#define substrait_Expression_Subquery_set_comparison_tag 4 +#define substrait_Expression_Subquery_InPredicate_needles_tag 1 +#define substrait_Expression_Subquery_InPredicate_haystack_tag 2 +#define substrait_Expression_Subquery_Scalar_input_tag 1 +#define substrait_Expression_Subquery_SetComparison_reduction_op_tag 1 +#define substrait_Expression_Subquery_SetComparison_comparison_op_tag 2 +#define substrait_Expression_Subquery_SetComparison_left_tag 3 +#define substrait_Expression_Subquery_SetComparison_right_tag 4 +#define substrait_Expression_Subquery_SetPredicate_predicate_op_tag 1 +#define substrait_Expression_Subquery_SetPredicate_tuples_tag 2 +#define substrait_Expression_SwitchExpression_ifs_tag 1 +#define substrait_Expression_SwitchExpression_else__tag 2 +#define substrait_Expression_SwitchExpression_match_tag 3 +#define substrait_Expression_SwitchExpression_IfValue_if__tag 1 +#define substrait_Expression_SwitchExpression_IfValue_then_tag 2 +#define substrait_Expression_WindowFunction_function_reference_tag 1 +#define substrait_Expression_WindowFunction_partitions_tag 2 +#define substrait_Expression_WindowFunction_sorts_tag 3 +#define substrait_Expression_WindowFunction_upper_bound_tag 4 +#define substrait_Expression_WindowFunction_lower_bound_tag 5 +#define substrait_Expression_WindowFunction_phase_tag 6 +#define substrait_Expression_WindowFunction_output_type_tag 7 +#define substrait_Expression_WindowFunction_args_tag 8 +#define substrait_Expression_WindowFunction_arguments_tag 9 +#define substrait_Expression_WindowFunction_Bound_preceding_tag 1 +#define substrait_Expression_WindowFunction_Bound_following_tag 2 +#define substrait_Expression_WindowFunction_Bound_current_row_tag 3 +#define substrait_Expression_WindowFunction_Bound_unbounded_tag 4 +#define substrait_Expression_WindowFunction_Bound_Following_offset_tag 1 +#define substrait_Expression_WindowFunction_Bound_Preceding_offset_tag 1 +#define substrait_ExtensionLeafRel_common_tag 1 +#define substrait_ExtensionLeafRel_detail_tag 2 +#define substrait_ExtensionMultiRel_common_tag 1 +#define substrait_ExtensionMultiRel_inputs_tag 2 +#define substrait_ExtensionMultiRel_detail_tag 3 +#define substrait_ExtensionSingleRel_common_tag 1 +#define substrait_ExtensionSingleRel_input_tag 2 +#define substrait_ExtensionSingleRel_detail_tag 3 +#define substrait_FetchRel_common_tag 1 +#define substrait_FetchRel_input_tag 2 +#define substrait_FetchRel_offset_tag 3 +#define substrait_FetchRel_count_tag 4 +#define substrait_FetchRel_advanced_extension_tag 10 +#define substrait_FilterRel_common_tag 1 +#define substrait_FilterRel_input_tag 2 +#define substrait_FilterRel_condition_tag 3 +#define substrait_FilterRel_advanced_extension_tag 10 +#define substrait_FunctionArgument_enum__tag 1 +#define substrait_FunctionArgument_type_tag 2 +#define substrait_FunctionArgument_value_tag 3 +#define substrait_FunctionArgument_Enum_specified_tag 1 +#define substrait_FunctionArgument_Enum_unspecified_tag 2 +#define substrait_JoinRel_common_tag 1 +#define substrait_JoinRel_left_tag 2 +#define substrait_JoinRel_right_tag 3 +#define substrait_JoinRel_expression_tag 4 +#define substrait_JoinRel_post_join_filter_tag 5 +#define substrait_JoinRel_type_tag 6 +#define substrait_JoinRel_advanced_extension_tag 10 +#define substrait_ProjectRel_common_tag 1 +#define substrait_ProjectRel_input_tag 2 +#define substrait_ProjectRel_expressions_tag 3 +#define substrait_ProjectRel_advanced_extension_tag 10 +#define substrait_ReadRel_common_tag 1 +#define substrait_ReadRel_base_schema_tag 2 +#define substrait_ReadRel_filter_tag 3 +#define substrait_ReadRel_projection_tag 4 +#define substrait_ReadRel_virtual_table_tag 5 +#define substrait_ReadRel_local_files_tag 6 +#define substrait_ReadRel_named_table_tag 7 +#define substrait_ReadRel_extension_table_tag 8 +#define substrait_ReadRel_advanced_extension_tag 10 +#define substrait_ReadRel_ExtensionTable_detail_tag 1 +#define substrait_ReadRel_LocalFiles_items_tag 1 +#define substrait_ReadRel_LocalFiles_advanced_extension_tag 10 +#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_path_tag 1 +#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_path_glob_tag 2 +#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_file_tag 3 +#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_folder_tag 4 +#define substrait_ReadRel_LocalFiles_FileOrFiles_partition_index_tag 6 +#define substrait_ReadRel_LocalFiles_FileOrFiles_start_tag 7 +#define substrait_ReadRel_LocalFiles_FileOrFiles_length_tag 8 +#define substrait_ReadRel_LocalFiles_FileOrFiles_parquet_tag 9 +#define substrait_ReadRel_LocalFiles_FileOrFiles_arrow_tag 10 +#define substrait_ReadRel_LocalFiles_FileOrFiles_orc_tag 11 +#define substrait_ReadRel_LocalFiles_FileOrFiles_extension_tag 12 +#define substrait_ReadRel_NamedTable_names_tag 1 +#define substrait_ReadRel_NamedTable_advanced_extension_tag 10 +#define substrait_ReadRel_VirtualTable_values_tag 1 +#define substrait_Rel_read_tag 1 +#define substrait_Rel_filter_tag 2 +#define substrait_Rel_fetch_tag 3 +#define substrait_Rel_aggregate_tag 4 +#define substrait_Rel_sort_tag 5 +#define substrait_Rel_join_tag 6 +#define substrait_Rel_project_tag 7 +#define substrait_Rel_set_tag 8 +#define substrait_Rel_extension_single_tag 9 +#define substrait_Rel_extension_multi_tag 10 +#define substrait_Rel_extension_leaf_tag 11 +#define substrait_Rel_cross_tag 12 +#define substrait_RelCommon_direct_tag 1 +#define substrait_RelCommon_emit_tag 2 +#define substrait_RelCommon_hint_tag 3 +#define substrait_RelCommon_advanced_extension_tag 4 +#define substrait_RelCommon_Emit_output_mapping_tag 1 +#define substrait_RelCommon_Hint_stats_tag 1 +#define substrait_RelCommon_Hint_constraint_tag 2 +#define substrait_RelCommon_Hint_advanced_extension_tag 10 +#define substrait_RelCommon_Hint_RuntimeConstraint_advanced_extension_tag 10 +#define substrait_RelCommon_Hint_Stats_row_count_tag 1 +#define substrait_RelCommon_Hint_Stats_record_size_tag 2 +#define substrait_RelCommon_Hint_Stats_advanced_extension_tag 10 +#define substrait_RelRoot_input_tag 1 +#define substrait_RelRoot_names_tag 2 +#define substrait_SetRel_common_tag 1 +#define substrait_SetRel_inputs_tag 2 +#define substrait_SetRel_op_tag 3 +#define substrait_SetRel_advanced_extension_tag 10 +#define substrait_SortField_expr_tag 1 +#define substrait_SortField_direction_tag 2 +#define substrait_SortField_comparison_function_reference_tag 3 +#define substrait_SortRel_common_tag 1 +#define substrait_SortRel_input_tag 2 +#define substrait_SortRel_sorts_tag 3 +#define substrait_SortRel_advanced_extension_tag 10 + +/* Struct field encoding specification for nanopb */ +#define substrait_RelCommon_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (emit_kind,direct,emit_kind.direct), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (emit_kind,emit,emit_kind.emit), 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, hint, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 4) +#define substrait_RelCommon_CALLBACK NULL +#define substrait_RelCommon_DEFAULT NULL +#define substrait_RelCommon_emit_kind_direct_MSGTYPE substrait_RelCommon_Direct +#define substrait_RelCommon_emit_kind_emit_MSGTYPE substrait_RelCommon_Emit +#define substrait_RelCommon_hint_MSGTYPE substrait_RelCommon_Hint +#define substrait_RelCommon_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_RelCommon_Direct_FIELDLIST(X, a) \ + +#define substrait_RelCommon_Direct_CALLBACK NULL +#define substrait_RelCommon_Direct_DEFAULT NULL + +#define substrait_RelCommon_Emit_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, INT32, output_mapping, 1) +#define substrait_RelCommon_Emit_CALLBACK NULL +#define substrait_RelCommon_Emit_DEFAULT NULL + +#define substrait_RelCommon_Hint_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, stats, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, constraint, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_RelCommon_Hint_CALLBACK NULL +#define substrait_RelCommon_Hint_DEFAULT NULL +#define substrait_RelCommon_Hint_stats_MSGTYPE substrait_RelCommon_Hint_Stats +#define substrait_RelCommon_Hint_constraint_MSGTYPE substrait_RelCommon_Hint_RuntimeConstraint +#define substrait_RelCommon_Hint_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_RelCommon_Hint_Stats_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, DOUBLE, row_count, 1) \ +X(a, POINTER, SINGULAR, DOUBLE, record_size, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_RelCommon_Hint_Stats_CALLBACK NULL +#define substrait_RelCommon_Hint_Stats_DEFAULT NULL +#define substrait_RelCommon_Hint_Stats_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_RelCommon_Hint_RuntimeConstraint_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_RelCommon_Hint_RuntimeConstraint_CALLBACK NULL +#define substrait_RelCommon_Hint_RuntimeConstraint_DEFAULT NULL +#define substrait_RelCommon_Hint_RuntimeConstraint_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_ReadRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, base_schema, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, filter, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, projection, 4) \ +X(a, POINTER, ONEOF, MESSAGE, (read_type,virtual_table,read_type.virtual_table), 5) \ +X(a, POINTER, ONEOF, MESSAGE, (read_type,local_files,read_type.local_files), 6) \ +X(a, POINTER, ONEOF, MESSAGE, (read_type,named_table,read_type.named_table), 7) \ +X(a, POINTER, ONEOF, MESSAGE, (read_type,extension_table,read_type.extension_table), 8) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_ReadRel_CALLBACK NULL +#define substrait_ReadRel_DEFAULT NULL +#define substrait_ReadRel_common_MSGTYPE substrait_RelCommon +#define substrait_ReadRel_base_schema_MSGTYPE substrait_NamedStruct +#define substrait_ReadRel_filter_MSGTYPE substrait_Expression +#define substrait_ReadRel_projection_MSGTYPE substrait_Expression_MaskExpression +#define substrait_ReadRel_read_type_virtual_table_MSGTYPE substrait_ReadRel_VirtualTable +#define substrait_ReadRel_read_type_local_files_MSGTYPE substrait_ReadRel_LocalFiles +#define substrait_ReadRel_read_type_named_table_MSGTYPE substrait_ReadRel_NamedTable +#define substrait_ReadRel_read_type_extension_table_MSGTYPE substrait_ReadRel_ExtensionTable +#define substrait_ReadRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_ReadRel_NamedTable_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, STRING, names, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_ReadRel_NamedTable_CALLBACK NULL +#define substrait_ReadRel_NamedTable_DEFAULT NULL +#define substrait_ReadRel_NamedTable_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_ReadRel_VirtualTable_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, values, 1) +#define substrait_ReadRel_VirtualTable_CALLBACK NULL +#define substrait_ReadRel_VirtualTable_DEFAULT NULL +#define substrait_ReadRel_VirtualTable_values_MSGTYPE substrait_Expression_Literal_Struct + +#define substrait_ReadRel_ExtensionTable_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, detail, 1) +#define substrait_ReadRel_ExtensionTable_CALLBACK NULL +#define substrait_ReadRel_ExtensionTable_DEFAULT NULL +#define substrait_ReadRel_ExtensionTable_detail_MSGTYPE substrait_Any + +#define substrait_ReadRel_LocalFiles_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, items, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_ReadRel_LocalFiles_CALLBACK NULL +#define substrait_ReadRel_LocalFiles_DEFAULT NULL +#define substrait_ReadRel_LocalFiles_items_MSGTYPE substrait_ReadRel_LocalFiles_FileOrFiles +#define substrait_ReadRel_LocalFiles_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_ReadRel_LocalFiles_FileOrFiles_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, STRING, (path_type,uri_path,path_type.uri_path), 1) \ +X(a, POINTER, ONEOF, STRING, (path_type,uri_path_glob,path_type.uri_path_glob), 2) \ +X(a, POINTER, ONEOF, STRING, (path_type,uri_file,path_type.uri_file), 3) \ +X(a, POINTER, ONEOF, STRING, (path_type,uri_folder,path_type.uri_folder), 4) \ +X(a, POINTER, SINGULAR, UINT64, partition_index, 6) \ +X(a, POINTER, SINGULAR, UINT64, start, 7) \ +X(a, POINTER, SINGULAR, UINT64, length, 8) \ +X(a, POINTER, ONEOF, MESSAGE, (file_format,parquet,file_format.parquet), 9) \ +X(a, POINTER, ONEOF, MESSAGE, (file_format,arrow,file_format.arrow), 10) \ +X(a, POINTER, ONEOF, MESSAGE, (file_format,orc,file_format.orc), 11) \ +X(a, POINTER, ONEOF, MESSAGE, (file_format,extension,file_format.extension), 12) +#define substrait_ReadRel_LocalFiles_FileOrFiles_CALLBACK NULL +#define substrait_ReadRel_LocalFiles_FileOrFiles_DEFAULT NULL +#define substrait_ReadRel_LocalFiles_FileOrFiles_file_format_parquet_MSGTYPE substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions +#define substrait_ReadRel_LocalFiles_FileOrFiles_file_format_arrow_MSGTYPE substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions +#define substrait_ReadRel_LocalFiles_FileOrFiles_file_format_orc_MSGTYPE substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions +#define substrait_ReadRel_LocalFiles_FileOrFiles_file_format_extension_MSGTYPE substrait_Any + +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_FIELDLIST(X, a) \ + +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_CALLBACK NULL +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_DEFAULT NULL + +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_FIELDLIST(X, a) \ + +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_CALLBACK NULL +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_DEFAULT NULL + +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_FIELDLIST(X, a) \ + +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_CALLBACK NULL +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_DEFAULT NULL + +#define substrait_ProjectRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, REPEATED, MESSAGE, expressions, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_ProjectRel_CALLBACK NULL +#define substrait_ProjectRel_DEFAULT NULL +#define substrait_ProjectRel_common_MSGTYPE substrait_RelCommon +#define substrait_ProjectRel_input_MSGTYPE substrait_Rel +#define substrait_ProjectRel_expressions_MSGTYPE substrait_Expression +#define substrait_ProjectRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_JoinRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, left, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, right, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, expression, 4) \ +X(a, POINTER, OPTIONAL, MESSAGE, post_join_filter, 5) \ +X(a, POINTER, SINGULAR, UENUM, type, 6) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_JoinRel_CALLBACK NULL +#define substrait_JoinRel_DEFAULT NULL +#define substrait_JoinRel_common_MSGTYPE substrait_RelCommon +#define substrait_JoinRel_left_MSGTYPE substrait_Rel +#define substrait_JoinRel_right_MSGTYPE substrait_Rel +#define substrait_JoinRel_expression_MSGTYPE substrait_Expression +#define substrait_JoinRel_post_join_filter_MSGTYPE substrait_Expression +#define substrait_JoinRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_CrossRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, left, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, right, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_CrossRel_CALLBACK NULL +#define substrait_CrossRel_DEFAULT NULL +#define substrait_CrossRel_common_MSGTYPE substrait_RelCommon +#define substrait_CrossRel_left_MSGTYPE substrait_Rel +#define substrait_CrossRel_right_MSGTYPE substrait_Rel +#define substrait_CrossRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_FetchRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, SINGULAR, INT64, offset, 3) \ +X(a, POINTER, SINGULAR, INT64, count, 4) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_FetchRel_CALLBACK NULL +#define substrait_FetchRel_DEFAULT NULL +#define substrait_FetchRel_common_MSGTYPE substrait_RelCommon +#define substrait_FetchRel_input_MSGTYPE substrait_Rel +#define substrait_FetchRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_AggregateRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, REPEATED, MESSAGE, groupings, 3) \ +X(a, POINTER, REPEATED, MESSAGE, measures, 4) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_AggregateRel_CALLBACK NULL +#define substrait_AggregateRel_DEFAULT NULL +#define substrait_AggregateRel_common_MSGTYPE substrait_RelCommon +#define substrait_AggregateRel_input_MSGTYPE substrait_Rel +#define substrait_AggregateRel_groupings_MSGTYPE substrait_AggregateRel_Grouping +#define substrait_AggregateRel_measures_MSGTYPE substrait_AggregateRel_Measure +#define substrait_AggregateRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_AggregateRel_Grouping_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, grouping_expressions, 1) +#define substrait_AggregateRel_Grouping_CALLBACK NULL +#define substrait_AggregateRel_Grouping_DEFAULT NULL +#define substrait_AggregateRel_Grouping_grouping_expressions_MSGTYPE substrait_Expression + +#define substrait_AggregateRel_Measure_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, measure, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, filter, 2) +#define substrait_AggregateRel_Measure_CALLBACK NULL +#define substrait_AggregateRel_Measure_DEFAULT NULL +#define substrait_AggregateRel_Measure_measure_MSGTYPE substrait_AggregateFunction +#define substrait_AggregateRel_Measure_filter_MSGTYPE substrait_Expression + +#define substrait_SortRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, REPEATED, MESSAGE, sorts, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_SortRel_CALLBACK NULL +#define substrait_SortRel_DEFAULT NULL +#define substrait_SortRel_common_MSGTYPE substrait_RelCommon +#define substrait_SortRel_input_MSGTYPE substrait_Rel +#define substrait_SortRel_sorts_MSGTYPE substrait_SortField +#define substrait_SortRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_FilterRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, condition, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_FilterRel_CALLBACK NULL +#define substrait_FilterRel_DEFAULT NULL +#define substrait_FilterRel_common_MSGTYPE substrait_RelCommon +#define substrait_FilterRel_input_MSGTYPE substrait_Rel +#define substrait_FilterRel_condition_MSGTYPE substrait_Expression +#define substrait_FilterRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_SetRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, REPEATED, MESSAGE, inputs, 2) \ +X(a, POINTER, SINGULAR, UENUM, op, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_SetRel_CALLBACK NULL +#define substrait_SetRel_DEFAULT NULL +#define substrait_SetRel_common_MSGTYPE substrait_RelCommon +#define substrait_SetRel_inputs_MSGTYPE substrait_Rel +#define substrait_SetRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_ExtensionSingleRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, detail, 3) +#define substrait_ExtensionSingleRel_CALLBACK NULL +#define substrait_ExtensionSingleRel_DEFAULT NULL +#define substrait_ExtensionSingleRel_common_MSGTYPE substrait_RelCommon +#define substrait_ExtensionSingleRel_input_MSGTYPE substrait_Rel +#define substrait_ExtensionSingleRel_detail_MSGTYPE substrait_Any + +#define substrait_ExtensionLeafRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, detail, 2) +#define substrait_ExtensionLeafRel_CALLBACK NULL +#define substrait_ExtensionLeafRel_DEFAULT NULL +#define substrait_ExtensionLeafRel_common_MSGTYPE substrait_RelCommon +#define substrait_ExtensionLeafRel_detail_MSGTYPE substrait_Any + +#define substrait_ExtensionMultiRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, REPEATED, MESSAGE, inputs, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, detail, 3) +#define substrait_ExtensionMultiRel_CALLBACK NULL +#define substrait_ExtensionMultiRel_DEFAULT NULL +#define substrait_ExtensionMultiRel_common_MSGTYPE substrait_RelCommon +#define substrait_ExtensionMultiRel_inputs_MSGTYPE substrait_Rel +#define substrait_ExtensionMultiRel_detail_MSGTYPE substrait_Any + +#define substrait_ExchangeRel_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, SINGULAR, INT32, partition_count, 3) \ +X(a, POINTER, REPEATED, MESSAGE, targets, 4) \ +X(a, POINTER, ONEOF, MESSAGE, (exchange_kind,scatter_by_fields,exchange_kind.scatter_by_fields), 5) \ +X(a, POINTER, ONEOF, MESSAGE, (exchange_kind,single_target,exchange_kind.single_target), 6) \ +X(a, POINTER, ONEOF, MESSAGE, (exchange_kind,multi_target,exchange_kind.multi_target), 7) \ +X(a, POINTER, ONEOF, MESSAGE, (exchange_kind,round_robin,exchange_kind.round_robin), 8) \ +X(a, POINTER, ONEOF, MESSAGE, (exchange_kind,broadcast,exchange_kind.broadcast), 9) \ +X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) +#define substrait_ExchangeRel_CALLBACK NULL +#define substrait_ExchangeRel_DEFAULT NULL +#define substrait_ExchangeRel_common_MSGTYPE substrait_RelCommon +#define substrait_ExchangeRel_input_MSGTYPE substrait_Rel +#define substrait_ExchangeRel_targets_MSGTYPE substrait_ExchangeRel_ExchangeTarget +#define substrait_ExchangeRel_exchange_kind_scatter_by_fields_MSGTYPE substrait_ExchangeRel_ScatterFields +#define substrait_ExchangeRel_exchange_kind_single_target_MSGTYPE substrait_ExchangeRel_SingleBucketExpression +#define substrait_ExchangeRel_exchange_kind_multi_target_MSGTYPE substrait_ExchangeRel_MultiBucketExpression +#define substrait_ExchangeRel_exchange_kind_round_robin_MSGTYPE substrait_ExchangeRel_RoundRobin +#define substrait_ExchangeRel_exchange_kind_broadcast_MSGTYPE substrait_ExchangeRel_Broadcast +#define substrait_ExchangeRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension + +#define substrait_ExchangeRel_ScatterFields_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, fields, 1) +#define substrait_ExchangeRel_ScatterFields_CALLBACK NULL +#define substrait_ExchangeRel_ScatterFields_DEFAULT NULL +#define substrait_ExchangeRel_ScatterFields_fields_MSGTYPE substrait_Expression_FieldReference + +#define substrait_ExchangeRel_SingleBucketExpression_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, expression, 1) +#define substrait_ExchangeRel_SingleBucketExpression_CALLBACK NULL +#define substrait_ExchangeRel_SingleBucketExpression_DEFAULT NULL +#define substrait_ExchangeRel_SingleBucketExpression_expression_MSGTYPE substrait_Expression + +#define substrait_ExchangeRel_MultiBucketExpression_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, expression, 1) \ +X(a, POINTER, SINGULAR, BOOL, constrained_to_count, 2) +#define substrait_ExchangeRel_MultiBucketExpression_CALLBACK NULL +#define substrait_ExchangeRel_MultiBucketExpression_DEFAULT NULL +#define substrait_ExchangeRel_MultiBucketExpression_expression_MSGTYPE substrait_Expression + +#define substrait_ExchangeRel_Broadcast_FIELDLIST(X, a) \ + +#define substrait_ExchangeRel_Broadcast_CALLBACK NULL +#define substrait_ExchangeRel_Broadcast_DEFAULT NULL + +#define substrait_ExchangeRel_RoundRobin_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, BOOL, exact, 1) +#define substrait_ExchangeRel_RoundRobin_CALLBACK NULL +#define substrait_ExchangeRel_RoundRobin_DEFAULT NULL + +#define substrait_ExchangeRel_ExchangeTarget_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, INT32, partition_id, 1) \ +X(a, POINTER, ONEOF, STRING, (target_type,uri,target_type.uri), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (target_type,extended,target_type.extended), 3) +#define substrait_ExchangeRel_ExchangeTarget_CALLBACK NULL +#define substrait_ExchangeRel_ExchangeTarget_DEFAULT NULL +#define substrait_ExchangeRel_ExchangeTarget_target_type_extended_MSGTYPE substrait_Any + +#define substrait_RelRoot_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 1) \ +X(a, POINTER, REPEATED, STRING, names, 2) +#define substrait_RelRoot_CALLBACK NULL +#define substrait_RelRoot_DEFAULT NULL +#define substrait_RelRoot_input_MSGTYPE substrait_Rel + +#define substrait_Rel_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,read,rel_type.read), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,filter,rel_type.filter), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,fetch,rel_type.fetch), 3) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,aggregate,rel_type.aggregate), 4) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,sort,rel_type.sort), 5) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,join,rel_type.join), 6) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,project,rel_type.project), 7) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,set,rel_type.set), 8) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,extension_single,rel_type.extension_single), 9) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,extension_multi,rel_type.extension_multi), 10) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,extension_leaf,rel_type.extension_leaf), 11) \ +X(a, POINTER, ONEOF, MESSAGE, (rel_type,cross,rel_type.cross), 12) +#define substrait_Rel_CALLBACK NULL +#define substrait_Rel_DEFAULT NULL +#define substrait_Rel_rel_type_read_MSGTYPE substrait_ReadRel +#define substrait_Rel_rel_type_filter_MSGTYPE substrait_FilterRel +#define substrait_Rel_rel_type_fetch_MSGTYPE substrait_FetchRel +#define substrait_Rel_rel_type_aggregate_MSGTYPE substrait_AggregateRel +#define substrait_Rel_rel_type_sort_MSGTYPE substrait_SortRel +#define substrait_Rel_rel_type_join_MSGTYPE substrait_JoinRel +#define substrait_Rel_rel_type_project_MSGTYPE substrait_ProjectRel +#define substrait_Rel_rel_type_set_MSGTYPE substrait_SetRel +#define substrait_Rel_rel_type_extension_single_MSGTYPE substrait_ExtensionSingleRel +#define substrait_Rel_rel_type_extension_multi_MSGTYPE substrait_ExtensionMultiRel +#define substrait_Rel_rel_type_extension_leaf_MSGTYPE substrait_ExtensionLeafRel +#define substrait_Rel_rel_type_cross_MSGTYPE substrait_CrossRel + +#define substrait_FunctionArgument_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (arg_type,enum_,arg_type.enum_), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (arg_type,type,arg_type.type), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (arg_type,value,arg_type.value), 3) +#define substrait_FunctionArgument_CALLBACK NULL +#define substrait_FunctionArgument_DEFAULT NULL +#define substrait_FunctionArgument_arg_type_enum__MSGTYPE substrait_FunctionArgument_Enum +#define substrait_FunctionArgument_arg_type_type_MSGTYPE substrait_Type +#define substrait_FunctionArgument_arg_type_value_MSGTYPE substrait_Expression + +#define substrait_FunctionArgument_Enum_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, STRING, (enum_kind,specified,enum_kind.specified), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (enum_kind,unspecified,enum_kind.unspecified), 2) +#define substrait_FunctionArgument_Enum_CALLBACK NULL +#define substrait_FunctionArgument_Enum_DEFAULT NULL +#define substrait_FunctionArgument_Enum_enum_kind_unspecified_MSGTYPE substrait_Any + +#define substrait_Expression_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,literal,rex_type.literal), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,selection,rex_type.selection), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,scalar_function,rex_type.scalar_function), 3) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,window_function,rex_type.window_function), 5) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,if_then,rex_type.if_then), 6) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,switch_expression,rex_type.switch_expression), 7) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,singular_or_list,rex_type.singular_or_list), 8) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,multi_or_list,rex_type.multi_or_list), 9) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,enum_,rex_type.enum_), 10) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,cast,rex_type.cast), 11) \ +X(a, POINTER, ONEOF, MESSAGE, (rex_type,subquery,rex_type.subquery), 12) +#define substrait_Expression_CALLBACK NULL +#define substrait_Expression_DEFAULT NULL +#define substrait_Expression_rex_type_literal_MSGTYPE substrait_Expression_Literal +#define substrait_Expression_rex_type_selection_MSGTYPE substrait_Expression_FieldReference +#define substrait_Expression_rex_type_scalar_function_MSGTYPE substrait_Expression_ScalarFunction +#define substrait_Expression_rex_type_window_function_MSGTYPE substrait_Expression_WindowFunction +#define substrait_Expression_rex_type_if_then_MSGTYPE substrait_Expression_IfThen +#define substrait_Expression_rex_type_switch_expression_MSGTYPE substrait_Expression_SwitchExpression +#define substrait_Expression_rex_type_singular_or_list_MSGTYPE substrait_Expression_SingularOrList +#define substrait_Expression_rex_type_multi_or_list_MSGTYPE substrait_Expression_MultiOrList +#define substrait_Expression_rex_type_enum__MSGTYPE substrait_Expression_Enum +#define substrait_Expression_rex_type_cast_MSGTYPE substrait_Expression_Cast +#define substrait_Expression_rex_type_subquery_MSGTYPE substrait_Expression_Subquery + +#define substrait_Expression_Enum_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, STRING, (enum_kind,specified,enum_kind.specified), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (enum_kind,unspecified,enum_kind.unspecified), 2) +#define substrait_Expression_Enum_CALLBACK NULL +#define substrait_Expression_Enum_DEFAULT NULL +#define substrait_Expression_Enum_enum_kind_unspecified_MSGTYPE substrait_Expression_Enum_Empty + +#define substrait_Expression_Enum_Empty_FIELDLIST(X, a) \ + +#define substrait_Expression_Enum_Empty_CALLBACK NULL +#define substrait_Expression_Enum_Empty_DEFAULT NULL + +#define substrait_Expression_Literal_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, BOOL, (literal_type,boolean,literal_type.boolean), 1) \ +X(a, POINTER, ONEOF, INT32, (literal_type,i8,literal_type.i8), 2) \ +X(a, POINTER, ONEOF, INT32, (literal_type,i16,literal_type.i16), 3) \ +X(a, POINTER, ONEOF, INT32, (literal_type,i32,literal_type.i32), 5) \ +X(a, POINTER, ONEOF, INT64, (literal_type,i64,literal_type.i64), 7) \ +X(a, POINTER, ONEOF, FLOAT, (literal_type,fp32,literal_type.fp32), 10) \ +X(a, POINTER, ONEOF, DOUBLE, (literal_type,fp64,literal_type.fp64), 11) \ +X(a, POINTER, ONEOF, STRING, (literal_type,string,literal_type.string), 12) \ +X(a, POINTER, ONEOF, BYTES, (literal_type,binary,literal_type.binary), 13) \ +X(a, POINTER, ONEOF, INT64, (literal_type,timestamp,literal_type.timestamp), 14) \ +X(a, POINTER, ONEOF, INT32, (literal_type,date,literal_type.date), 16) \ +X(a, POINTER, ONEOF, INT64, (literal_type,time,literal_type.time), 17) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,interval_year_to_month,literal_type.interval_year_to_month), 19) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,interval_day_to_second,literal_type.interval_day_to_second), 20) \ +X(a, POINTER, ONEOF, STRING, (literal_type,fixed_char,literal_type.fixed_char), 21) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,var_char,literal_type.var_char), 22) \ +X(a, POINTER, ONEOF, BYTES, (literal_type,fixed_binary,literal_type.fixed_binary), 23) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,decimal,literal_type.decimal), 24) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,struct_,literal_type.struct_), 25) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,map,literal_type.map), 26) \ +X(a, POINTER, ONEOF, INT64, (literal_type,timestamp_tz,literal_type.timestamp_tz), 27) \ +X(a, POINTER, ONEOF, BYTES, (literal_type,uuid,literal_type.uuid), 28) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,null,literal_type.null), 29) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,list,literal_type.list), 30) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,empty_list,literal_type.empty_list), 31) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,empty_map,literal_type.empty_map), 32) \ +X(a, POINTER, ONEOF, MESSAGE, (literal_type,user_defined,literal_type.user_defined), 33) \ +X(a, POINTER, SINGULAR, BOOL, nullable, 50) \ +X(a, POINTER, SINGULAR, UINT32, type_variation_reference, 51) +#define substrait_Expression_Literal_CALLBACK NULL +#define substrait_Expression_Literal_DEFAULT NULL +#define substrait_Expression_Literal_literal_type_interval_year_to_month_MSGTYPE substrait_Expression_Literal_IntervalYearToMonth +#define substrait_Expression_Literal_literal_type_interval_day_to_second_MSGTYPE substrait_Expression_Literal_IntervalDayToSecond +#define substrait_Expression_Literal_literal_type_var_char_MSGTYPE substrait_Expression_Literal_VarChar +#define substrait_Expression_Literal_literal_type_decimal_MSGTYPE substrait_Expression_Literal_Decimal +#define substrait_Expression_Literal_literal_type_struct__MSGTYPE substrait_Expression_Literal_Struct +#define substrait_Expression_Literal_literal_type_map_MSGTYPE substrait_Expression_Literal_Map +#define substrait_Expression_Literal_literal_type_null_MSGTYPE substrait_Type +#define substrait_Expression_Literal_literal_type_list_MSGTYPE substrait_Expression_Literal_List +#define substrait_Expression_Literal_literal_type_empty_list_MSGTYPE substrait_Type_List +#define substrait_Expression_Literal_literal_type_empty_map_MSGTYPE substrait_Type_Map +#define substrait_Expression_Literal_literal_type_user_defined_MSGTYPE substrait_Expression_Literal_UserDefined + +#define substrait_Expression_Literal_VarChar_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, STRING, value, 1) \ +X(a, POINTER, SINGULAR, UINT32, length, 2) +#define substrait_Expression_Literal_VarChar_CALLBACK NULL +#define substrait_Expression_Literal_VarChar_DEFAULT NULL + +#define substrait_Expression_Literal_Decimal_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, BYTES, value, 1) \ +X(a, POINTER, SINGULAR, INT32, precision, 2) \ +X(a, POINTER, SINGULAR, INT32, scale, 3) +#define substrait_Expression_Literal_Decimal_CALLBACK NULL +#define substrait_Expression_Literal_Decimal_DEFAULT NULL + +#define substrait_Expression_Literal_Map_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, key_values, 1) +#define substrait_Expression_Literal_Map_CALLBACK NULL +#define substrait_Expression_Literal_Map_DEFAULT NULL +#define substrait_Expression_Literal_Map_key_values_MSGTYPE substrait_Expression_Literal_Map_KeyValue + +#define substrait_Expression_Literal_Map_KeyValue_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, key, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, value, 2) +#define substrait_Expression_Literal_Map_KeyValue_CALLBACK NULL +#define substrait_Expression_Literal_Map_KeyValue_DEFAULT NULL +#define substrait_Expression_Literal_Map_KeyValue_key_MSGTYPE substrait_Expression_Literal +#define substrait_Expression_Literal_Map_KeyValue_value_MSGTYPE substrait_Expression_Literal + +#define substrait_Expression_Literal_IntervalYearToMonth_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, years, 1) \ +X(a, POINTER, SINGULAR, INT32, months, 2) +#define substrait_Expression_Literal_IntervalYearToMonth_CALLBACK NULL +#define substrait_Expression_Literal_IntervalYearToMonth_DEFAULT NULL + +#define substrait_Expression_Literal_IntervalDayToSecond_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, days, 1) \ +X(a, POINTER, SINGULAR, INT32, seconds, 2) \ +X(a, POINTER, SINGULAR, INT32, microseconds, 3) +#define substrait_Expression_Literal_IntervalDayToSecond_CALLBACK NULL +#define substrait_Expression_Literal_IntervalDayToSecond_DEFAULT NULL + +#define substrait_Expression_Literal_Struct_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, fields, 1) +#define substrait_Expression_Literal_Struct_CALLBACK NULL +#define substrait_Expression_Literal_Struct_DEFAULT NULL +#define substrait_Expression_Literal_Struct_fields_MSGTYPE substrait_Expression_Literal + +#define substrait_Expression_Literal_List_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, values, 1) +#define substrait_Expression_Literal_List_CALLBACK NULL +#define substrait_Expression_Literal_List_DEFAULT NULL +#define substrait_Expression_Literal_List_values_MSGTYPE substrait_Expression_Literal + +#define substrait_Expression_Literal_UserDefined_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, type_reference, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, value, 2) +#define substrait_Expression_Literal_UserDefined_CALLBACK NULL +#define substrait_Expression_Literal_UserDefined_DEFAULT NULL +#define substrait_Expression_Literal_UserDefined_value_MSGTYPE substrait_Any + +#define substrait_Expression_ScalarFunction_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, function_reference, 1) \ +X(a, POINTER, REPEATED, MESSAGE, args, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, output_type, 3) \ +X(a, POINTER, REPEATED, MESSAGE, arguments, 4) +#define substrait_Expression_ScalarFunction_CALLBACK NULL +#define substrait_Expression_ScalarFunction_DEFAULT NULL +#define substrait_Expression_ScalarFunction_args_MSGTYPE substrait_Expression +#define substrait_Expression_ScalarFunction_output_type_MSGTYPE substrait_Type +#define substrait_Expression_ScalarFunction_arguments_MSGTYPE substrait_FunctionArgument + +#define substrait_Expression_WindowFunction_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, function_reference, 1) \ +X(a, POINTER, REPEATED, MESSAGE, partitions, 2) \ +X(a, POINTER, REPEATED, MESSAGE, sorts, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, upper_bound, 4) \ +X(a, POINTER, OPTIONAL, MESSAGE, lower_bound, 5) \ +X(a, POINTER, SINGULAR, UENUM, phase, 6) \ +X(a, POINTER, OPTIONAL, MESSAGE, output_type, 7) \ +X(a, POINTER, REPEATED, MESSAGE, args, 8) \ +X(a, POINTER, REPEATED, MESSAGE, arguments, 9) +#define substrait_Expression_WindowFunction_CALLBACK NULL +#define substrait_Expression_WindowFunction_DEFAULT NULL +#define substrait_Expression_WindowFunction_partitions_MSGTYPE substrait_Expression +#define substrait_Expression_WindowFunction_sorts_MSGTYPE substrait_SortField +#define substrait_Expression_WindowFunction_upper_bound_MSGTYPE substrait_Expression_WindowFunction_Bound +#define substrait_Expression_WindowFunction_lower_bound_MSGTYPE substrait_Expression_WindowFunction_Bound +#define substrait_Expression_WindowFunction_output_type_MSGTYPE substrait_Type +#define substrait_Expression_WindowFunction_args_MSGTYPE substrait_Expression +#define substrait_Expression_WindowFunction_arguments_MSGTYPE substrait_FunctionArgument + +#define substrait_Expression_WindowFunction_Bound_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,preceding,kind.preceding), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,following,kind.following), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,current_row,kind.current_row), 3) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,unbounded,kind.unbounded), 4) +#define substrait_Expression_WindowFunction_Bound_CALLBACK NULL +#define substrait_Expression_WindowFunction_Bound_DEFAULT NULL +#define substrait_Expression_WindowFunction_Bound_kind_preceding_MSGTYPE substrait_Expression_WindowFunction_Bound_Preceding +#define substrait_Expression_WindowFunction_Bound_kind_following_MSGTYPE substrait_Expression_WindowFunction_Bound_Following +#define substrait_Expression_WindowFunction_Bound_kind_current_row_MSGTYPE substrait_Expression_WindowFunction_Bound_CurrentRow +#define substrait_Expression_WindowFunction_Bound_kind_unbounded_MSGTYPE substrait_Expression_WindowFunction_Bound_Unbounded + +#define substrait_Expression_WindowFunction_Bound_Preceding_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT64, offset, 1) +#define substrait_Expression_WindowFunction_Bound_Preceding_CALLBACK NULL +#define substrait_Expression_WindowFunction_Bound_Preceding_DEFAULT NULL + +#define substrait_Expression_WindowFunction_Bound_Following_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT64, offset, 1) +#define substrait_Expression_WindowFunction_Bound_Following_CALLBACK NULL +#define substrait_Expression_WindowFunction_Bound_Following_DEFAULT NULL + +#define substrait_Expression_WindowFunction_Bound_CurrentRow_FIELDLIST(X, a) \ + +#define substrait_Expression_WindowFunction_Bound_CurrentRow_CALLBACK NULL +#define substrait_Expression_WindowFunction_Bound_CurrentRow_DEFAULT NULL + +#define substrait_Expression_WindowFunction_Bound_Unbounded_FIELDLIST(X, a) \ + +#define substrait_Expression_WindowFunction_Bound_Unbounded_CALLBACK NULL +#define substrait_Expression_WindowFunction_Bound_Unbounded_DEFAULT NULL + +#define substrait_Expression_IfThen_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, ifs, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, else_, 2) +#define substrait_Expression_IfThen_CALLBACK NULL +#define substrait_Expression_IfThen_DEFAULT NULL +#define substrait_Expression_IfThen_ifs_MSGTYPE substrait_Expression_IfThen_IfClause +#define substrait_Expression_IfThen_else__MSGTYPE substrait_Expression + +#define substrait_Expression_IfThen_IfClause_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, if_, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, then, 2) +#define substrait_Expression_IfThen_IfClause_CALLBACK NULL +#define substrait_Expression_IfThen_IfClause_DEFAULT NULL +#define substrait_Expression_IfThen_IfClause_if__MSGTYPE substrait_Expression +#define substrait_Expression_IfThen_IfClause_then_MSGTYPE substrait_Expression + +#define substrait_Expression_Cast_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, type, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ +X(a, POINTER, SINGULAR, UENUM, failure_behavior, 3) +#define substrait_Expression_Cast_CALLBACK NULL +#define substrait_Expression_Cast_DEFAULT NULL +#define substrait_Expression_Cast_type_MSGTYPE substrait_Type +#define substrait_Expression_Cast_input_MSGTYPE substrait_Expression + +#define substrait_Expression_SwitchExpression_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, ifs, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, else_, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, match, 3) +#define substrait_Expression_SwitchExpression_CALLBACK NULL +#define substrait_Expression_SwitchExpression_DEFAULT NULL +#define substrait_Expression_SwitchExpression_ifs_MSGTYPE substrait_Expression_SwitchExpression_IfValue +#define substrait_Expression_SwitchExpression_else__MSGTYPE substrait_Expression +#define substrait_Expression_SwitchExpression_match_MSGTYPE substrait_Expression + +#define substrait_Expression_SwitchExpression_IfValue_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, if_, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, then, 2) +#define substrait_Expression_SwitchExpression_IfValue_CALLBACK NULL +#define substrait_Expression_SwitchExpression_IfValue_DEFAULT NULL +#define substrait_Expression_SwitchExpression_IfValue_if__MSGTYPE substrait_Expression_Literal +#define substrait_Expression_SwitchExpression_IfValue_then_MSGTYPE substrait_Expression + +#define substrait_Expression_SingularOrList_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, value, 1) \ +X(a, POINTER, REPEATED, MESSAGE, options, 2) +#define substrait_Expression_SingularOrList_CALLBACK NULL +#define substrait_Expression_SingularOrList_DEFAULT NULL +#define substrait_Expression_SingularOrList_value_MSGTYPE substrait_Expression +#define substrait_Expression_SingularOrList_options_MSGTYPE substrait_Expression + +#define substrait_Expression_MultiOrList_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, value, 1) \ +X(a, POINTER, REPEATED, MESSAGE, options, 2) +#define substrait_Expression_MultiOrList_CALLBACK NULL +#define substrait_Expression_MultiOrList_DEFAULT NULL +#define substrait_Expression_MultiOrList_value_MSGTYPE substrait_Expression +#define substrait_Expression_MultiOrList_options_MSGTYPE substrait_Expression_MultiOrList_Record + +#define substrait_Expression_MultiOrList_Record_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, fields, 1) +#define substrait_Expression_MultiOrList_Record_CALLBACK NULL +#define substrait_Expression_MultiOrList_Record_DEFAULT NULL +#define substrait_Expression_MultiOrList_Record_fields_MSGTYPE substrait_Expression + +#define substrait_Expression_EmbeddedFunction_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, arguments, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, output_type, 2) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,python_pickle_function,kind.python_pickle_function), 3) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,web_assembly_function,kind.web_assembly_function), 4) +#define substrait_Expression_EmbeddedFunction_CALLBACK NULL +#define substrait_Expression_EmbeddedFunction_DEFAULT NULL +#define substrait_Expression_EmbeddedFunction_arguments_MSGTYPE substrait_Expression +#define substrait_Expression_EmbeddedFunction_output_type_MSGTYPE substrait_Type +#define substrait_Expression_EmbeddedFunction_kind_python_pickle_function_MSGTYPE substrait_Expression_EmbeddedFunction_PythonPickleFunction +#define substrait_Expression_EmbeddedFunction_kind_web_assembly_function_MSGTYPE substrait_Expression_EmbeddedFunction_WebAssemblyFunction + +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, BYTES, function_, 1) \ +X(a, POINTER, REPEATED, STRING, prerequisite, 2) +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_CALLBACK NULL +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_DEFAULT NULL + +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, BYTES, script, 1) \ +X(a, POINTER, REPEATED, STRING, prerequisite, 2) +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_CALLBACK NULL +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_DEFAULT NULL + +#define substrait_Expression_ReferenceSegment_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (reference_type,map_key,reference_type.map_key), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (reference_type,struct_field,reference_type.struct_field), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (reference_type,list_element,reference_type.list_element), 3) +#define substrait_Expression_ReferenceSegment_CALLBACK NULL +#define substrait_Expression_ReferenceSegment_DEFAULT NULL +#define substrait_Expression_ReferenceSegment_reference_type_map_key_MSGTYPE substrait_Expression_ReferenceSegment_MapKey +#define substrait_Expression_ReferenceSegment_reference_type_struct_field_MSGTYPE substrait_Expression_ReferenceSegment_StructField +#define substrait_Expression_ReferenceSegment_reference_type_list_element_MSGTYPE substrait_Expression_ReferenceSegment_ListElement + +#define substrait_Expression_ReferenceSegment_MapKey_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, map_key, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, child, 2) +#define substrait_Expression_ReferenceSegment_MapKey_CALLBACK NULL +#define substrait_Expression_ReferenceSegment_MapKey_DEFAULT NULL +#define substrait_Expression_ReferenceSegment_MapKey_map_key_MSGTYPE substrait_Expression_Literal +#define substrait_Expression_ReferenceSegment_MapKey_child_MSGTYPE substrait_Expression_ReferenceSegment + +#define substrait_Expression_ReferenceSegment_StructField_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, field, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, child, 2) +#define substrait_Expression_ReferenceSegment_StructField_CALLBACK NULL +#define substrait_Expression_ReferenceSegment_StructField_DEFAULT NULL +#define substrait_Expression_ReferenceSegment_StructField_child_MSGTYPE substrait_Expression_ReferenceSegment + +#define substrait_Expression_ReferenceSegment_ListElement_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, offset, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, child, 2) +#define substrait_Expression_ReferenceSegment_ListElement_CALLBACK NULL +#define substrait_Expression_ReferenceSegment_ListElement_DEFAULT NULL +#define substrait_Expression_ReferenceSegment_ListElement_child_MSGTYPE substrait_Expression_ReferenceSegment + +#define substrait_Expression_MaskExpression_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, select, 1) \ +X(a, POINTER, SINGULAR, BOOL, maintain_singular_struct_, 2) +#define substrait_Expression_MaskExpression_CALLBACK NULL +#define substrait_Expression_MaskExpression_DEFAULT NULL +#define substrait_Expression_MaskExpression_select_MSGTYPE substrait_Expression_MaskExpression_StructSelect + +#define substrait_Expression_MaskExpression_Select_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (type,struct_,type.struct_), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (type,list,type.list), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (type,map,type.map), 3) +#define substrait_Expression_MaskExpression_Select_CALLBACK NULL +#define substrait_Expression_MaskExpression_Select_DEFAULT NULL +#define substrait_Expression_MaskExpression_Select_type_struct__MSGTYPE substrait_Expression_MaskExpression_StructSelect +#define substrait_Expression_MaskExpression_Select_type_list_MSGTYPE substrait_Expression_MaskExpression_ListSelect +#define substrait_Expression_MaskExpression_Select_type_map_MSGTYPE substrait_Expression_MaskExpression_MapSelect + +#define substrait_Expression_MaskExpression_StructSelect_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, struct_items, 1) +#define substrait_Expression_MaskExpression_StructSelect_CALLBACK NULL +#define substrait_Expression_MaskExpression_StructSelect_DEFAULT NULL +#define substrait_Expression_MaskExpression_StructSelect_struct_items_MSGTYPE substrait_Expression_MaskExpression_StructItem + +#define substrait_Expression_MaskExpression_StructItem_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, field, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, child, 2) +#define substrait_Expression_MaskExpression_StructItem_CALLBACK NULL +#define substrait_Expression_MaskExpression_StructItem_DEFAULT NULL +#define substrait_Expression_MaskExpression_StructItem_child_MSGTYPE substrait_Expression_MaskExpression_Select + +#define substrait_Expression_MaskExpression_ListSelect_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, selection, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, child, 2) +#define substrait_Expression_MaskExpression_ListSelect_CALLBACK NULL +#define substrait_Expression_MaskExpression_ListSelect_DEFAULT NULL +#define substrait_Expression_MaskExpression_ListSelect_selection_MSGTYPE substrait_Expression_MaskExpression_ListSelect_ListSelectItem +#define substrait_Expression_MaskExpression_ListSelect_child_MSGTYPE substrait_Expression_MaskExpression_Select + +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (type,item,type.item), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (type,slice,type.slice), 2) +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_CALLBACK NULL +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_DEFAULT NULL +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_type_item_MSGTYPE substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_type_slice_MSGTYPE substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice + +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, field, 1) +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_CALLBACK NULL +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_DEFAULT NULL + +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, INT32, start, 1) \ +X(a, POINTER, SINGULAR, INT32, end, 2) +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_CALLBACK NULL +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_DEFAULT NULL + +#define substrait_Expression_MaskExpression_MapSelect_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (select,key,select.key), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (select,expression,select.expression), 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, child, 3) +#define substrait_Expression_MaskExpression_MapSelect_CALLBACK NULL +#define substrait_Expression_MaskExpression_MapSelect_DEFAULT NULL +#define substrait_Expression_MaskExpression_MapSelect_select_key_MSGTYPE substrait_Expression_MaskExpression_MapSelect_MapKey +#define substrait_Expression_MaskExpression_MapSelect_select_expression_MSGTYPE substrait_Expression_MaskExpression_MapSelect_MapKeyExpression +#define substrait_Expression_MaskExpression_MapSelect_child_MSGTYPE substrait_Expression_MaskExpression_Select + +#define substrait_Expression_MaskExpression_MapSelect_MapKey_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, STRING, map_key, 1) +#define substrait_Expression_MaskExpression_MapSelect_MapKey_CALLBACK NULL +#define substrait_Expression_MaskExpression_MapSelect_MapKey_DEFAULT NULL + +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, STRING, map_key_expression, 1) +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_CALLBACK NULL +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_DEFAULT NULL + +#define substrait_Expression_FieldReference_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (reference_type,direct_reference,reference_type.direct_reference), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (reference_type,masked_reference,reference_type.masked_reference), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (root_type,expression,root_type.expression), 3) \ +X(a, POINTER, ONEOF, MESSAGE, (root_type,root_reference,root_type.root_reference), 4) \ +X(a, POINTER, ONEOF, MESSAGE, (root_type,outer_reference,root_type.outer_reference), 5) +#define substrait_Expression_FieldReference_CALLBACK NULL +#define substrait_Expression_FieldReference_DEFAULT NULL +#define substrait_Expression_FieldReference_reference_type_direct_reference_MSGTYPE substrait_Expression_ReferenceSegment +#define substrait_Expression_FieldReference_reference_type_masked_reference_MSGTYPE substrait_Expression_MaskExpression +#define substrait_Expression_FieldReference_root_type_expression_MSGTYPE substrait_Expression +#define substrait_Expression_FieldReference_root_type_root_reference_MSGTYPE substrait_Expression_FieldReference_RootReference +#define substrait_Expression_FieldReference_root_type_outer_reference_MSGTYPE substrait_Expression_FieldReference_OuterReference + +#define substrait_Expression_FieldReference_RootReference_FIELDLIST(X, a) \ + +#define substrait_Expression_FieldReference_RootReference_CALLBACK NULL +#define substrait_Expression_FieldReference_RootReference_DEFAULT NULL + +#define substrait_Expression_FieldReference_OuterReference_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, steps_out, 1) +#define substrait_Expression_FieldReference_OuterReference_CALLBACK NULL +#define substrait_Expression_FieldReference_OuterReference_DEFAULT NULL + +#define substrait_Expression_Subquery_FIELDLIST(X, a) \ +X(a, POINTER, ONEOF, MESSAGE, (subquery_type,scalar,subquery_type.scalar), 1) \ +X(a, POINTER, ONEOF, MESSAGE, (subquery_type,in_predicate,subquery_type.in_predicate), 2) \ +X(a, POINTER, ONEOF, MESSAGE, (subquery_type,set_predicate,subquery_type.set_predicate), 3) \ +X(a, POINTER, ONEOF, MESSAGE, (subquery_type,set_comparison,subquery_type.set_comparison), 4) +#define substrait_Expression_Subquery_CALLBACK NULL +#define substrait_Expression_Subquery_DEFAULT NULL +#define substrait_Expression_Subquery_subquery_type_scalar_MSGTYPE substrait_Expression_Subquery_Scalar +#define substrait_Expression_Subquery_subquery_type_in_predicate_MSGTYPE substrait_Expression_Subquery_InPredicate +#define substrait_Expression_Subquery_subquery_type_set_predicate_MSGTYPE substrait_Expression_Subquery_SetPredicate +#define substrait_Expression_Subquery_subquery_type_set_comparison_MSGTYPE substrait_Expression_Subquery_SetComparison + +#define substrait_Expression_Subquery_Scalar_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, input, 1) +#define substrait_Expression_Subquery_Scalar_CALLBACK NULL +#define substrait_Expression_Subquery_Scalar_DEFAULT NULL +#define substrait_Expression_Subquery_Scalar_input_MSGTYPE substrait_Rel + +#define substrait_Expression_Subquery_InPredicate_FIELDLIST(X, a) \ +X(a, POINTER, REPEATED, MESSAGE, needles, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, haystack, 2) +#define substrait_Expression_Subquery_InPredicate_CALLBACK NULL +#define substrait_Expression_Subquery_InPredicate_DEFAULT NULL +#define substrait_Expression_Subquery_InPredicate_needles_MSGTYPE substrait_Expression +#define substrait_Expression_Subquery_InPredicate_haystack_MSGTYPE substrait_Rel + +#define substrait_Expression_Subquery_SetPredicate_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UENUM, predicate_op, 1) \ +X(a, POINTER, OPTIONAL, MESSAGE, tuples, 2) +#define substrait_Expression_Subquery_SetPredicate_CALLBACK NULL +#define substrait_Expression_Subquery_SetPredicate_DEFAULT NULL +#define substrait_Expression_Subquery_SetPredicate_tuples_MSGTYPE substrait_Rel + +#define substrait_Expression_Subquery_SetComparison_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UENUM, reduction_op, 1) \ +X(a, POINTER, SINGULAR, UENUM, comparison_op, 2) \ +X(a, POINTER, OPTIONAL, MESSAGE, left, 3) \ +X(a, POINTER, OPTIONAL, MESSAGE, right, 4) +#define substrait_Expression_Subquery_SetComparison_CALLBACK NULL +#define substrait_Expression_Subquery_SetComparison_DEFAULT NULL +#define substrait_Expression_Subquery_SetComparison_left_MSGTYPE substrait_Expression +#define substrait_Expression_Subquery_SetComparison_right_MSGTYPE substrait_Rel + +#define substrait_SortField_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, expr, 1) \ +X(a, POINTER, ONEOF, UENUM, (sort_kind,direction,sort_kind.direction), 2) \ +X(a, POINTER, ONEOF, UINT32, (sort_kind,comparison_function_reference,sort_kind.comparison_function_reference), 3) +#define substrait_SortField_CALLBACK NULL +#define substrait_SortField_DEFAULT NULL +#define substrait_SortField_expr_MSGTYPE substrait_Expression + +#define substrait_AggregateFunction_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, function_reference, 1) \ +X(a, POINTER, REPEATED, MESSAGE, args, 2) \ +X(a, POINTER, REPEATED, MESSAGE, sorts, 3) \ +X(a, POINTER, SINGULAR, UENUM, phase, 4) \ +X(a, POINTER, OPTIONAL, MESSAGE, output_type, 5) \ +X(a, POINTER, SINGULAR, UENUM, invocation, 6) \ +X(a, POINTER, REPEATED, MESSAGE, arguments, 7) +#define substrait_AggregateFunction_CALLBACK NULL +#define substrait_AggregateFunction_DEFAULT NULL +#define substrait_AggregateFunction_args_MSGTYPE substrait_Expression +#define substrait_AggregateFunction_sorts_MSGTYPE substrait_SortField +#define substrait_AggregateFunction_output_type_MSGTYPE substrait_Type +#define substrait_AggregateFunction_arguments_MSGTYPE substrait_FunctionArgument + +extern const pb_msgdesc_t substrait_RelCommon_msg; +extern const pb_msgdesc_t substrait_RelCommon_Direct_msg; +extern const pb_msgdesc_t substrait_RelCommon_Emit_msg; +extern const pb_msgdesc_t substrait_RelCommon_Hint_msg; +extern const pb_msgdesc_t substrait_RelCommon_Hint_Stats_msg; +extern const pb_msgdesc_t substrait_RelCommon_Hint_RuntimeConstraint_msg; +extern const pb_msgdesc_t substrait_ReadRel_msg; +extern const pb_msgdesc_t substrait_ReadRel_NamedTable_msg; +extern const pb_msgdesc_t substrait_ReadRel_VirtualTable_msg; +extern const pb_msgdesc_t substrait_ReadRel_ExtensionTable_msg; +extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_msg; +extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_FileOrFiles_msg; +extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_msg; +extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_msg; +extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_msg; +extern const pb_msgdesc_t substrait_ProjectRel_msg; +extern const pb_msgdesc_t substrait_JoinRel_msg; +extern const pb_msgdesc_t substrait_CrossRel_msg; +extern const pb_msgdesc_t substrait_FetchRel_msg; +extern const pb_msgdesc_t substrait_AggregateRel_msg; +extern const pb_msgdesc_t substrait_AggregateRel_Grouping_msg; +extern const pb_msgdesc_t substrait_AggregateRel_Measure_msg; +extern const pb_msgdesc_t substrait_SortRel_msg; +extern const pb_msgdesc_t substrait_FilterRel_msg; +extern const pb_msgdesc_t substrait_SetRel_msg; +extern const pb_msgdesc_t substrait_ExtensionSingleRel_msg; +extern const pb_msgdesc_t substrait_ExtensionLeafRel_msg; +extern const pb_msgdesc_t substrait_ExtensionMultiRel_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_ScatterFields_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_SingleBucketExpression_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_MultiBucketExpression_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_Broadcast_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_RoundRobin_msg; +extern const pb_msgdesc_t substrait_ExchangeRel_ExchangeTarget_msg; +extern const pb_msgdesc_t substrait_RelRoot_msg; +extern const pb_msgdesc_t substrait_Rel_msg; +extern const pb_msgdesc_t substrait_FunctionArgument_msg; +extern const pb_msgdesc_t substrait_FunctionArgument_Enum_msg; +extern const pb_msgdesc_t substrait_Expression_msg; +extern const pb_msgdesc_t substrait_Expression_Enum_msg; +extern const pb_msgdesc_t substrait_Expression_Enum_Empty_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_VarChar_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_Decimal_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_Map_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_Map_KeyValue_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_IntervalYearToMonth_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_IntervalDayToSecond_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_Struct_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_List_msg; +extern const pb_msgdesc_t substrait_Expression_Literal_UserDefined_msg; +extern const pb_msgdesc_t substrait_Expression_ScalarFunction_msg; +extern const pb_msgdesc_t substrait_Expression_WindowFunction_msg; +extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_msg; +extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_Preceding_msg; +extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_Following_msg; +extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_CurrentRow_msg; +extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_Unbounded_msg; +extern const pb_msgdesc_t substrait_Expression_IfThen_msg; +extern const pb_msgdesc_t substrait_Expression_IfThen_IfClause_msg; +extern const pb_msgdesc_t substrait_Expression_Cast_msg; +extern const pb_msgdesc_t substrait_Expression_SwitchExpression_msg; +extern const pb_msgdesc_t substrait_Expression_SwitchExpression_IfValue_msg; +extern const pb_msgdesc_t substrait_Expression_SingularOrList_msg; +extern const pb_msgdesc_t substrait_Expression_MultiOrList_msg; +extern const pb_msgdesc_t substrait_Expression_MultiOrList_Record_msg; +extern const pb_msgdesc_t substrait_Expression_EmbeddedFunction_msg; +extern const pb_msgdesc_t substrait_Expression_EmbeddedFunction_PythonPickleFunction_msg; +extern const pb_msgdesc_t substrait_Expression_EmbeddedFunction_WebAssemblyFunction_msg; +extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_msg; +extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_MapKey_msg; +extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_StructField_msg; +extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_ListElement_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_Select_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_StructSelect_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_StructItem_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_ListSelectItem_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_MapSelect_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_MapSelect_MapKey_msg; +extern const pb_msgdesc_t substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_msg; +extern const pb_msgdesc_t substrait_Expression_FieldReference_msg; +extern const pb_msgdesc_t substrait_Expression_FieldReference_RootReference_msg; +extern const pb_msgdesc_t substrait_Expression_FieldReference_OuterReference_msg; +extern const pb_msgdesc_t substrait_Expression_Subquery_msg; +extern const pb_msgdesc_t substrait_Expression_Subquery_Scalar_msg; +extern const pb_msgdesc_t substrait_Expression_Subquery_InPredicate_msg; +extern const pb_msgdesc_t substrait_Expression_Subquery_SetPredicate_msg; +extern const pb_msgdesc_t substrait_Expression_Subquery_SetComparison_msg; +extern const pb_msgdesc_t substrait_SortField_msg; +extern const pb_msgdesc_t substrait_AggregateFunction_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define substrait_RelCommon_fields &substrait_RelCommon_msg +#define substrait_RelCommon_Direct_fields &substrait_RelCommon_Direct_msg +#define substrait_RelCommon_Emit_fields &substrait_RelCommon_Emit_msg +#define substrait_RelCommon_Hint_fields &substrait_RelCommon_Hint_msg +#define substrait_RelCommon_Hint_Stats_fields &substrait_RelCommon_Hint_Stats_msg +#define substrait_RelCommon_Hint_RuntimeConstraint_fields &substrait_RelCommon_Hint_RuntimeConstraint_msg +#define substrait_ReadRel_fields &substrait_ReadRel_msg +#define substrait_ReadRel_NamedTable_fields &substrait_ReadRel_NamedTable_msg +#define substrait_ReadRel_VirtualTable_fields &substrait_ReadRel_VirtualTable_msg +#define substrait_ReadRel_ExtensionTable_fields &substrait_ReadRel_ExtensionTable_msg +#define substrait_ReadRel_LocalFiles_fields &substrait_ReadRel_LocalFiles_msg +#define substrait_ReadRel_LocalFiles_FileOrFiles_fields &substrait_ReadRel_LocalFiles_FileOrFiles_msg +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_fields &substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_msg +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_fields &substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_msg +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_fields &substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_msg +#define substrait_ProjectRel_fields &substrait_ProjectRel_msg +#define substrait_JoinRel_fields &substrait_JoinRel_msg +#define substrait_CrossRel_fields &substrait_CrossRel_msg +#define substrait_FetchRel_fields &substrait_FetchRel_msg +#define substrait_AggregateRel_fields &substrait_AggregateRel_msg +#define substrait_AggregateRel_Grouping_fields &substrait_AggregateRel_Grouping_msg +#define substrait_AggregateRel_Measure_fields &substrait_AggregateRel_Measure_msg +#define substrait_SortRel_fields &substrait_SortRel_msg +#define substrait_FilterRel_fields &substrait_FilterRel_msg +#define substrait_SetRel_fields &substrait_SetRel_msg +#define substrait_ExtensionSingleRel_fields &substrait_ExtensionSingleRel_msg +#define substrait_ExtensionLeafRel_fields &substrait_ExtensionLeafRel_msg +#define substrait_ExtensionMultiRel_fields &substrait_ExtensionMultiRel_msg +#define substrait_ExchangeRel_fields &substrait_ExchangeRel_msg +#define substrait_ExchangeRel_ScatterFields_fields &substrait_ExchangeRel_ScatterFields_msg +#define substrait_ExchangeRel_SingleBucketExpression_fields &substrait_ExchangeRel_SingleBucketExpression_msg +#define substrait_ExchangeRel_MultiBucketExpression_fields &substrait_ExchangeRel_MultiBucketExpression_msg +#define substrait_ExchangeRel_Broadcast_fields &substrait_ExchangeRel_Broadcast_msg +#define substrait_ExchangeRel_RoundRobin_fields &substrait_ExchangeRel_RoundRobin_msg +#define substrait_ExchangeRel_ExchangeTarget_fields &substrait_ExchangeRel_ExchangeTarget_msg +#define substrait_RelRoot_fields &substrait_RelRoot_msg +#define substrait_Rel_fields &substrait_Rel_msg +#define substrait_FunctionArgument_fields &substrait_FunctionArgument_msg +#define substrait_FunctionArgument_Enum_fields &substrait_FunctionArgument_Enum_msg +#define substrait_Expression_fields &substrait_Expression_msg +#define substrait_Expression_Enum_fields &substrait_Expression_Enum_msg +#define substrait_Expression_Enum_Empty_fields &substrait_Expression_Enum_Empty_msg +#define substrait_Expression_Literal_fields &substrait_Expression_Literal_msg +#define substrait_Expression_Literal_VarChar_fields &substrait_Expression_Literal_VarChar_msg +#define substrait_Expression_Literal_Decimal_fields &substrait_Expression_Literal_Decimal_msg +#define substrait_Expression_Literal_Map_fields &substrait_Expression_Literal_Map_msg +#define substrait_Expression_Literal_Map_KeyValue_fields &substrait_Expression_Literal_Map_KeyValue_msg +#define substrait_Expression_Literal_IntervalYearToMonth_fields &substrait_Expression_Literal_IntervalYearToMonth_msg +#define substrait_Expression_Literal_IntervalDayToSecond_fields &substrait_Expression_Literal_IntervalDayToSecond_msg +#define substrait_Expression_Literal_Struct_fields &substrait_Expression_Literal_Struct_msg +#define substrait_Expression_Literal_List_fields &substrait_Expression_Literal_List_msg +#define substrait_Expression_Literal_UserDefined_fields &substrait_Expression_Literal_UserDefined_msg +#define substrait_Expression_ScalarFunction_fields &substrait_Expression_ScalarFunction_msg +#define substrait_Expression_WindowFunction_fields &substrait_Expression_WindowFunction_msg +#define substrait_Expression_WindowFunction_Bound_fields &substrait_Expression_WindowFunction_Bound_msg +#define substrait_Expression_WindowFunction_Bound_Preceding_fields &substrait_Expression_WindowFunction_Bound_Preceding_msg +#define substrait_Expression_WindowFunction_Bound_Following_fields &substrait_Expression_WindowFunction_Bound_Following_msg +#define substrait_Expression_WindowFunction_Bound_CurrentRow_fields &substrait_Expression_WindowFunction_Bound_CurrentRow_msg +#define substrait_Expression_WindowFunction_Bound_Unbounded_fields &substrait_Expression_WindowFunction_Bound_Unbounded_msg +#define substrait_Expression_IfThen_fields &substrait_Expression_IfThen_msg +#define substrait_Expression_IfThen_IfClause_fields &substrait_Expression_IfThen_IfClause_msg +#define substrait_Expression_Cast_fields &substrait_Expression_Cast_msg +#define substrait_Expression_SwitchExpression_fields &substrait_Expression_SwitchExpression_msg +#define substrait_Expression_SwitchExpression_IfValue_fields &substrait_Expression_SwitchExpression_IfValue_msg +#define substrait_Expression_SingularOrList_fields &substrait_Expression_SingularOrList_msg +#define substrait_Expression_MultiOrList_fields &substrait_Expression_MultiOrList_msg +#define substrait_Expression_MultiOrList_Record_fields &substrait_Expression_MultiOrList_Record_msg +#define substrait_Expression_EmbeddedFunction_fields &substrait_Expression_EmbeddedFunction_msg +#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_fields &substrait_Expression_EmbeddedFunction_PythonPickleFunction_msg +#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_fields &substrait_Expression_EmbeddedFunction_WebAssemblyFunction_msg +#define substrait_Expression_ReferenceSegment_fields &substrait_Expression_ReferenceSegment_msg +#define substrait_Expression_ReferenceSegment_MapKey_fields &substrait_Expression_ReferenceSegment_MapKey_msg +#define substrait_Expression_ReferenceSegment_StructField_fields &substrait_Expression_ReferenceSegment_StructField_msg +#define substrait_Expression_ReferenceSegment_ListElement_fields &substrait_Expression_ReferenceSegment_ListElement_msg +#define substrait_Expression_MaskExpression_fields &substrait_Expression_MaskExpression_msg +#define substrait_Expression_MaskExpression_Select_fields &substrait_Expression_MaskExpression_Select_msg +#define substrait_Expression_MaskExpression_StructSelect_fields &substrait_Expression_MaskExpression_StructSelect_msg +#define substrait_Expression_MaskExpression_StructItem_fields &substrait_Expression_MaskExpression_StructItem_msg +#define substrait_Expression_MaskExpression_ListSelect_fields &substrait_Expression_MaskExpression_ListSelect_msg +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_fields &substrait_Expression_MaskExpression_ListSelect_ListSelectItem_msg +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_fields &substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_msg +#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_fields &substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_msg +#define substrait_Expression_MaskExpression_MapSelect_fields &substrait_Expression_MaskExpression_MapSelect_msg +#define substrait_Expression_MaskExpression_MapSelect_MapKey_fields &substrait_Expression_MaskExpression_MapSelect_MapKey_msg +#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_fields &substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_msg +#define substrait_Expression_FieldReference_fields &substrait_Expression_FieldReference_msg +#define substrait_Expression_FieldReference_RootReference_fields &substrait_Expression_FieldReference_RootReference_msg +#define substrait_Expression_FieldReference_OuterReference_fields &substrait_Expression_FieldReference_OuterReference_msg +#define substrait_Expression_Subquery_fields &substrait_Expression_Subquery_msg +#define substrait_Expression_Subquery_Scalar_fields &substrait_Expression_Subquery_Scalar_msg +#define substrait_Expression_Subquery_InPredicate_fields &substrait_Expression_Subquery_InPredicate_msg +#define substrait_Expression_Subquery_SetPredicate_fields &substrait_Expression_Subquery_SetPredicate_msg +#define substrait_Expression_Subquery_SetComparison_fields &substrait_Expression_Subquery_SetComparison_msg +#define substrait_SortField_fields &substrait_SortField_msg +#define substrait_AggregateFunction_fields &substrait_AggregateFunction_msg + +/* Maximum encoded size of messages (where known) */ +/* substrait_RelCommon_size depends on runtime parameters */ +/* substrait_RelCommon_Emit_size depends on runtime parameters */ +/* substrait_RelCommon_Hint_size depends on runtime parameters */ +/* substrait_RelCommon_Hint_Stats_size depends on runtime parameters */ +/* substrait_RelCommon_Hint_RuntimeConstraint_size depends on runtime parameters */ +/* substrait_ReadRel_size depends on runtime parameters */ +/* substrait_ReadRel_NamedTable_size depends on runtime parameters */ +/* substrait_ReadRel_VirtualTable_size depends on runtime parameters */ +/* substrait_ReadRel_ExtensionTable_size depends on runtime parameters */ +/* substrait_ReadRel_LocalFiles_size depends on runtime parameters */ +/* substrait_ReadRel_LocalFiles_FileOrFiles_size depends on runtime parameters */ +/* substrait_ProjectRel_size depends on runtime parameters */ +/* substrait_JoinRel_size depends on runtime parameters */ +/* substrait_CrossRel_size depends on runtime parameters */ +/* substrait_FetchRel_size depends on runtime parameters */ +/* substrait_AggregateRel_size depends on runtime parameters */ +/* substrait_AggregateRel_Grouping_size depends on runtime parameters */ +/* substrait_AggregateRel_Measure_size depends on runtime parameters */ +/* substrait_SortRel_size depends on runtime parameters */ +/* substrait_FilterRel_size depends on runtime parameters */ +/* substrait_SetRel_size depends on runtime parameters */ +/* substrait_ExtensionSingleRel_size depends on runtime parameters */ +/* substrait_ExtensionLeafRel_size depends on runtime parameters */ +/* substrait_ExtensionMultiRel_size depends on runtime parameters */ +/* substrait_ExchangeRel_size depends on runtime parameters */ +/* substrait_ExchangeRel_ScatterFields_size depends on runtime parameters */ +/* substrait_ExchangeRel_SingleBucketExpression_size depends on runtime parameters */ +/* substrait_ExchangeRel_MultiBucketExpression_size depends on runtime parameters */ +/* substrait_ExchangeRel_RoundRobin_size depends on runtime parameters */ +/* substrait_ExchangeRel_ExchangeTarget_size depends on runtime parameters */ +/* substrait_RelRoot_size depends on runtime parameters */ +/* substrait_Rel_size depends on runtime parameters */ +/* substrait_FunctionArgument_size depends on runtime parameters */ +/* substrait_FunctionArgument_Enum_size depends on runtime parameters */ +/* substrait_Expression_size depends on runtime parameters */ +/* substrait_Expression_Enum_size depends on runtime parameters */ +/* substrait_Expression_Literal_size depends on runtime parameters */ +/* substrait_Expression_Literal_VarChar_size depends on runtime parameters */ +/* substrait_Expression_Literal_Decimal_size depends on runtime parameters */ +/* substrait_Expression_Literal_Map_size depends on runtime parameters */ +/* substrait_Expression_Literal_Map_KeyValue_size depends on runtime parameters */ +/* substrait_Expression_Literal_IntervalYearToMonth_size depends on runtime parameters */ +/* substrait_Expression_Literal_IntervalDayToSecond_size depends on runtime parameters */ +/* substrait_Expression_Literal_Struct_size depends on runtime parameters */ +/* substrait_Expression_Literal_List_size depends on runtime parameters */ +/* substrait_Expression_Literal_UserDefined_size depends on runtime parameters */ +/* substrait_Expression_ScalarFunction_size depends on runtime parameters */ +/* substrait_Expression_WindowFunction_size depends on runtime parameters */ +/* substrait_Expression_WindowFunction_Bound_size depends on runtime parameters */ +/* substrait_Expression_WindowFunction_Bound_Preceding_size depends on runtime parameters */ +/* substrait_Expression_WindowFunction_Bound_Following_size depends on runtime parameters */ +/* substrait_Expression_IfThen_size depends on runtime parameters */ +/* substrait_Expression_IfThen_IfClause_size depends on runtime parameters */ +/* substrait_Expression_Cast_size depends on runtime parameters */ +/* substrait_Expression_SwitchExpression_size depends on runtime parameters */ +/* substrait_Expression_SwitchExpression_IfValue_size depends on runtime parameters */ +/* substrait_Expression_SingularOrList_size depends on runtime parameters */ +/* substrait_Expression_MultiOrList_size depends on runtime parameters */ +/* substrait_Expression_MultiOrList_Record_size depends on runtime parameters */ +/* substrait_Expression_EmbeddedFunction_size depends on runtime parameters */ +/* substrait_Expression_EmbeddedFunction_PythonPickleFunction_size depends on runtime parameters */ +/* substrait_Expression_EmbeddedFunction_WebAssemblyFunction_size depends on runtime parameters */ +/* substrait_Expression_ReferenceSegment_size depends on runtime parameters */ +/* substrait_Expression_ReferenceSegment_MapKey_size depends on runtime parameters */ +/* substrait_Expression_ReferenceSegment_StructField_size depends on runtime parameters */ +/* substrait_Expression_ReferenceSegment_ListElement_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_Select_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_StructSelect_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_StructItem_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_ListSelect_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_ListSelect_ListSelectItem_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_MapSelect_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_MapSelect_MapKey_size depends on runtime parameters */ +/* substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_size depends on runtime parameters */ +/* substrait_Expression_FieldReference_size depends on runtime parameters */ +/* substrait_Expression_FieldReference_OuterReference_size depends on runtime parameters */ +/* substrait_Expression_Subquery_size depends on runtime parameters */ +/* substrait_Expression_Subquery_Scalar_size depends on runtime parameters */ +/* substrait_Expression_Subquery_InPredicate_size depends on runtime parameters */ +/* substrait_Expression_Subquery_SetPredicate_size depends on runtime parameters */ +/* substrait_Expression_Subquery_SetComparison_size depends on runtime parameters */ +/* substrait_SortField_size depends on runtime parameters */ +/* substrait_AggregateFunction_size depends on runtime parameters */ +#define substrait_ExchangeRel_Broadcast_size 0 +#define substrait_Expression_Enum_Empty_size 0 +#define substrait_Expression_FieldReference_RootReference_size 0 +#define substrait_Expression_WindowFunction_Bound_CurrentRow_size 0 +#define substrait_Expression_WindowFunction_Bound_Unbounded_size 0 +#define substrait_ReadRel_LocalFiles_FileOrFiles_ArrowReadOptions_size 0 +#define substrait_ReadRel_LocalFiles_FileOrFiles_OrcReadOptions_size 0 +#define substrait_ReadRel_LocalFiles_FileOrFiles_ParquetReadOptions_size 0 +#define substrait_RelCommon_Direct_size 0 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/substrait/any.pb.h b/src/substrait/any.pb.h index 2d1eae01..f902baa1 100644 --- a/src/substrait/any.pb.h +++ b/src/substrait/any.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_ANY_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_ANY_PB_H_INCLUDED @@ -11,10 +11,14 @@ /* Struct definitions */ typedef struct _substrait_Any { - char *type_url; - pb_bytes_array_t *value; + char *type_url; + pb_bytes_array_t *value; } substrait_Any; +typedef struct _substrait_Empty { + char dummy_field; +} substrait_Empty; + #ifdef __cplusplus extern "C" { @@ -22,7 +26,9 @@ extern "C" { /* Initializer values for message structs */ #define substrait_Any_init_default {NULL, NULL} +#define substrait_Empty_init_default {0} #define substrait_Any_init_zero {NULL, NULL} +#define substrait_Empty_init_zero {0} /* Field tags (for use in manual encoding/decoding) */ #define substrait_Any_type_url_tag 1 @@ -35,13 +41,21 @@ X(a, POINTER, SINGULAR, BYTES, value, 2) #define substrait_Any_CALLBACK NULL #define substrait_Any_DEFAULT NULL +#define substrait_Empty_FIELDLIST(X, a) \ + +#define substrait_Empty_CALLBACK NULL +#define substrait_Empty_DEFAULT NULL + extern const pb_msgdesc_t substrait_Any_msg; +extern const pb_msgdesc_t substrait_Empty_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define substrait_Any_fields &substrait_Any_msg +#define substrait_Empty_fields &substrait_Empty_msg /* Maximum encoded size of messages (where known) */ /* substrait_Any_size depends on runtime parameters */ +#define substrait_Empty_size 0 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/substrait/capabilities.pb.h b/src/substrait/capabilities.pb.h index eb2ff21e..998537b9 100644 --- a/src/substrait/capabilities.pb.h +++ b/src/substrait/capabilities.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_CAPABILITIES_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_CAPABILITIES_PB_H_INCLUDED @@ -14,24 +14,24 @@ typedef struct _substrait_Capabilities { /* List of Substrait versions this system supports */ pb_size_t substrait_versions_count; - char **substrait_versions; + char **substrait_versions; /* list of com.google.Any message types this system supports for advanced extensions. */ pb_size_t advanced_extension_type_urls_count; - char **advanced_extension_type_urls; + char **advanced_extension_type_urls; /* list of simple extensions this system supports. */ pb_size_t simple_extensions_count; - struct _substrait_Capabilities_SimpleExtension *simple_extensions; + struct _substrait_Capabilities_SimpleExtension *simple_extensions; } substrait_Capabilities; typedef struct _substrait_Capabilities_SimpleExtension { - char *uri; + char *uri; pb_size_t function_keys_count; - char **function_keys; + char **function_keys; pb_size_t type_keys_count; - char **type_keys; + char **type_keys; pb_size_t type_variation_keys_count; - char **type_variation_keys; + char **type_variation_keys; } substrait_Capabilities_SimpleExtension; diff --git a/src/substrait/expression.pb.h b/src/substrait/expression.pb.h deleted file mode 100644 index 9b6d2fcf..00000000 --- a/src/substrait/expression.pb.h +++ /dev/null @@ -1,1200 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ - -#ifndef PB_SUBSTRAIT_SUBSTRAIT_EXPRESSION_PB_H_INCLUDED -#define PB_SUBSTRAIT_SUBSTRAIT_EXPRESSION_PB_H_INCLUDED -#include -#include "substrait/type.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -typedef enum _substrait_AggregationPhase { - substrait_AggregationPhase_AGGREGATION_PHASE_UNSPECIFIED = 0, - substrait_AggregationPhase_AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE = 1, - substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE = 2, - substrait_AggregationPhase_AGGREGATION_PHASE_INITIAL_TO_RESULT = 3, - substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT = 4 -} substrait_AggregationPhase; - -typedef enum _substrait_SortField_SortDirection { - substrait_SortField_SortDirection_SORT_DIRECTION_UNSPECIFIED = 0, - substrait_SortField_SortDirection_SORT_DIRECTION_ASC_NULLS_FIRST = 1, - substrait_SortField_SortDirection_SORT_DIRECTION_ASC_NULLS_LAST = 2, - substrait_SortField_SortDirection_SORT_DIRECTION_DESC_NULLS_FIRST = 3, - substrait_SortField_SortDirection_SORT_DIRECTION_DESC_NULLS_LAST = 4, - substrait_SortField_SortDirection_SORT_DIRECTION_CLUSTERED = 5 -} substrait_SortField_SortDirection; - -/* Struct definitions */ -typedef struct _substrait_AggregateFunction { - uint32_t *function_reference; - pb_size_t args_count; - struct _substrait_Expression *args; - pb_size_t sorts_count; - struct _substrait_SortField *sorts; - substrait_AggregationPhase *phase; - struct _substrait_Type *output_type; -} substrait_AggregateFunction; - -typedef struct _substrait_Expression { - pb_size_t which_rex_type; - union { - struct _substrait_Expression_Literal *literal; - struct _substrait_Expression_FieldReference *selection; - struct _substrait_Expression_ScalarFunction *scalar_function; - struct _substrait_Expression_WindowFunction *window_function; - struct _substrait_Expression_IfThen *if_then; - struct _substrait_Expression_SwitchExpression *switch_expression; - struct _substrait_Expression_SingularOrList *singular_or_list; - struct _substrait_Expression_MultiOrList *multi_or_list; - struct _substrait_Expression_Enum *enum_; - struct _substrait_Expression_Cast *cast; - } rex_type; -} substrait_Expression; - -typedef struct _substrait_Expression_Cast { - struct _substrait_Type *type; - struct _substrait_Expression *input; -} substrait_Expression_Cast; - -typedef struct _substrait_Expression_EmbeddedFunction { - pb_size_t arguments_count; - struct _substrait_Expression *arguments; - struct _substrait_Type *output_type; - pb_size_t which_kind; - union { - struct _substrait_Expression_EmbeddedFunction_PythonPickleFunction *python_pickle_function; - struct _substrait_Expression_EmbeddedFunction_WebAssemblyFunction *web_assembly_function; - } kind; -} substrait_Expression_EmbeddedFunction; - -typedef struct _substrait_Expression_EmbeddedFunction_PythonPickleFunction { - pb_bytes_array_t *function_; - pb_size_t prerequisite_count; - char **prerequisite; -} substrait_Expression_EmbeddedFunction_PythonPickleFunction; - -typedef struct _substrait_Expression_EmbeddedFunction_WebAssemblyFunction { - pb_bytes_array_t *script; - pb_size_t prerequisite_count; - char **prerequisite; -} substrait_Expression_EmbeddedFunction_WebAssemblyFunction; - -typedef struct _substrait_Expression_Enum { - pb_size_t which_enum_kind; - union { - char *specified; - struct _substrait_Expression_Enum_Empty *unspecified; - } enum_kind; -} substrait_Expression_Enum; - -typedef struct _substrait_Expression_Enum_Empty { - char dummy_field; -} substrait_Expression_Enum_Empty; - -typedef struct _substrait_Expression_FieldReference { - pb_size_t which_reference_type; - union { - struct _substrait_Expression_ReferenceSegment *direct_reference; - struct _substrait_Expression_MaskExpression *masked_reference; - } reference_type; - pb_size_t which_root_type; - union { - struct _substrait_Expression *expression; - struct _substrait_Expression_FieldReference_RootReference *root_reference; - } root_type; -} substrait_Expression_FieldReference; - -typedef struct _substrait_Expression_FieldReference_RootReference { - char dummy_field; -} substrait_Expression_FieldReference_RootReference; - -typedef struct _substrait_Expression_IfThen { - pb_size_t ifs_count; - struct _substrait_Expression_IfThen_IfClause *ifs; - struct _substrait_Expression *else_; -} substrait_Expression_IfThen; - -typedef struct _substrait_Expression_IfThen_IfClause { - struct _substrait_Expression *if_; - struct _substrait_Expression *then; -} substrait_Expression_IfThen_IfClause; - -typedef struct _substrait_Expression_Literal { - pb_size_t which_literal_type; - union { - bool *boolean; - int32_t *i8; - int32_t *i16; - int32_t *i32; - int64_t *i64; - float *fp32; - double *fp64; - char *string; - pb_bytes_array_t *binary; - int64_t *timestamp; - int32_t *date; - int64_t *time; - struct _substrait_Expression_Literal_IntervalYearToMonth *interval_year_to_month; - struct _substrait_Expression_Literal_IntervalDayToSecond *interval_day_to_second; - char *fixed_char; - struct _substrait_Expression_Literal_VarChar *var_char; - pb_bytes_array_t *fixed_binary; - struct _substrait_Expression_Literal_Decimal *decimal; - struct _substrait_Expression_Literal_Struct *struct_; - struct _substrait_Expression_Literal_Map *map; - int64_t *timestamp_tz; - pb_bytes_array_t *uuid; - struct _substrait_Type *null; - struct _substrait_Expression_Literal_List *list; - struct _substrait_Type_List *empty_list; - struct _substrait_Type_Map *empty_map; - } literal_type; - bool *nullable; -} substrait_Expression_Literal; - -typedef struct _substrait_Expression_Literal_Decimal { - pb_bytes_array_t *value; - int32_t *precision; - int32_t *scale; -} substrait_Expression_Literal_Decimal; - -typedef struct _substrait_Expression_Literal_IntervalDayToSecond { - int32_t *days; - int32_t *seconds; -} substrait_Expression_Literal_IntervalDayToSecond; - -typedef struct _substrait_Expression_Literal_IntervalYearToMonth { - int32_t *years; - int32_t *months; -} substrait_Expression_Literal_IntervalYearToMonth; - -typedef struct _substrait_Expression_Literal_List { - pb_size_t values_count; - struct _substrait_Expression_Literal *values; -} substrait_Expression_Literal_List; - -typedef struct _substrait_Expression_Literal_Map { - pb_size_t key_values_count; - struct _substrait_Expression_Literal_Map_KeyValue *key_values; -} substrait_Expression_Literal_Map; - -typedef struct _substrait_Expression_Literal_Map_KeyValue { - struct _substrait_Expression_Literal *key; - struct _substrait_Expression_Literal *value; -} substrait_Expression_Literal_Map_KeyValue; - -typedef struct _substrait_Expression_Literal_Struct { - pb_size_t fields_count; - struct _substrait_Expression_Literal *fields; -} substrait_Expression_Literal_Struct; - -typedef struct _substrait_Expression_Literal_VarChar { - char *value; - uint32_t *length; -} substrait_Expression_Literal_VarChar; - -typedef struct _substrait_Expression_MaskExpression { - struct _substrait_Expression_MaskExpression_StructSelect *select; - bool *maintain_singular_struct; -} substrait_Expression_MaskExpression; - -typedef struct _substrait_Expression_MaskExpression_ListSelect { - pb_size_t selection_count; - struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem *selection; - struct _substrait_Expression_MaskExpression_Select *child; -} substrait_Expression_MaskExpression_ListSelect; - -typedef struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem { - pb_size_t which_type; - union { - struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement *item; - struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice *slice; - } type; -} substrait_Expression_MaskExpression_ListSelect_ListSelectItem; - -typedef struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement { - int32_t *field; -} substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement; - -typedef struct _substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice { - int32_t *start; - int32_t *end; -} substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice; - -typedef struct _substrait_Expression_MaskExpression_MapSelect { - pb_size_t which_select; - union { - struct _substrait_Expression_MaskExpression_MapSelect_MapKey *key; - struct _substrait_Expression_MaskExpression_MapSelect_MapKeyExpression *expression; - } select; - struct _substrait_Expression_MaskExpression_Select *child; -} substrait_Expression_MaskExpression_MapSelect; - -typedef struct _substrait_Expression_MaskExpression_MapSelect_MapKey { - char *map_key; -} substrait_Expression_MaskExpression_MapSelect_MapKey; - -typedef struct _substrait_Expression_MaskExpression_MapSelect_MapKeyExpression { - char *map_key_expression; -} substrait_Expression_MaskExpression_MapSelect_MapKeyExpression; - -typedef struct _substrait_Expression_MaskExpression_Select { - pb_size_t which_type; - union { - struct _substrait_Expression_MaskExpression_StructSelect *struct_; - struct _substrait_Expression_MaskExpression_ListSelect *list; - struct _substrait_Expression_MaskExpression_MapSelect *map; - } type; -} substrait_Expression_MaskExpression_Select; - -typedef struct _substrait_Expression_MaskExpression_StructItem { - int32_t *field; - struct _substrait_Expression_MaskExpression_Select *child; -} substrait_Expression_MaskExpression_StructItem; - -typedef struct _substrait_Expression_MaskExpression_StructSelect { - pb_size_t struct_items_count; - struct _substrait_Expression_MaskExpression_StructItem *struct_items; -} substrait_Expression_MaskExpression_StructSelect; - -typedef struct _substrait_Expression_MultiOrList { - pb_size_t value_count; - struct _substrait_Expression *value; - pb_size_t options_count; - struct _substrait_Expression_MultiOrList_Record *options; -} substrait_Expression_MultiOrList; - -typedef struct _substrait_Expression_MultiOrList_Record { - pb_size_t fields_count; - struct _substrait_Expression *fields; -} substrait_Expression_MultiOrList_Record; - -typedef struct _substrait_Expression_ReferenceSegment { - pb_size_t which_reference_type; - union { - struct _substrait_Expression_ReferenceSegment_MapKey *map_key; - struct _substrait_Expression_ReferenceSegment_StructField *struct_field; - struct _substrait_Expression_ReferenceSegment_ListElement *list_element; - } reference_type; -} substrait_Expression_ReferenceSegment; - -typedef struct _substrait_Expression_ReferenceSegment_ListElement { - int32_t *offset; - struct _substrait_Expression_ReferenceSegment *child; -} substrait_Expression_ReferenceSegment_ListElement; - -typedef struct _substrait_Expression_ReferenceSegment_MapKey { - struct _substrait_Expression_Literal *map_key; - struct _substrait_Expression_ReferenceSegment *child; -} substrait_Expression_ReferenceSegment_MapKey; - -typedef struct _substrait_Expression_ReferenceSegment_StructField { - int32_t *field; - struct _substrait_Expression_ReferenceSegment *child; -} substrait_Expression_ReferenceSegment_StructField; - -typedef struct _substrait_Expression_ScalarFunction { - uint32_t *function_reference; - pb_size_t args_count; - struct _substrait_Expression *args; - struct _substrait_Type *output_type; -} substrait_Expression_ScalarFunction; - -typedef struct _substrait_Expression_SingularOrList { - struct _substrait_Expression *value; - pb_size_t options_count; - struct _substrait_Expression *options; -} substrait_Expression_SingularOrList; - -typedef struct _substrait_Expression_SwitchExpression { - pb_size_t ifs_count; - struct _substrait_Expression_SwitchExpression_IfValue *ifs; - struct _substrait_Expression *else_; -} substrait_Expression_SwitchExpression; - -typedef struct _substrait_Expression_SwitchExpression_IfValue { - struct _substrait_Expression_Literal *if_; - struct _substrait_Expression *then; -} substrait_Expression_SwitchExpression_IfValue; - -typedef struct _substrait_Expression_WindowFunction { - uint32_t *function_reference; - pb_size_t partitions_count; - struct _substrait_Expression *partitions; - pb_size_t sorts_count; - struct _substrait_SortField *sorts; - struct _substrait_Expression_WindowFunction_Bound *upper_bound; - struct _substrait_Expression_WindowFunction_Bound *lower_bound; - substrait_AggregationPhase *phase; - struct _substrait_Type *output_type; - pb_size_t args_count; - struct _substrait_Expression *args; -} substrait_Expression_WindowFunction; - -typedef struct _substrait_Expression_WindowFunction_Bound { - pb_size_t which_kind; - union { - struct _substrait_Expression_WindowFunction_Bound_Preceding *preceding; - struct _substrait_Expression_WindowFunction_Bound_Following *following; - struct _substrait_Expression_WindowFunction_Bound_CurrentRow *current_row; - struct _substrait_Expression_WindowFunction_Bound_Unbounded *unbounded; - } kind; -} substrait_Expression_WindowFunction_Bound; - -typedef struct _substrait_Expression_WindowFunction_Bound_CurrentRow { - char dummy_field; -} substrait_Expression_WindowFunction_Bound_CurrentRow; - -typedef struct _substrait_Expression_WindowFunction_Bound_Following { - int64_t *offset; -} substrait_Expression_WindowFunction_Bound_Following; - -typedef struct _substrait_Expression_WindowFunction_Bound_Preceding { - int64_t *offset; -} substrait_Expression_WindowFunction_Bound_Preceding; - -typedef struct _substrait_Expression_WindowFunction_Bound_Unbounded { - char dummy_field; -} substrait_Expression_WindowFunction_Bound_Unbounded; - -typedef struct _substrait_SortField { - struct _substrait_Expression *expr; - pb_size_t which_sort_kind; - union { - substrait_SortField_SortDirection *direction; - uint32_t *comparison_function_reference; - } sort_kind; -} substrait_SortField; - - -/* Helper constants for enums */ -#define _substrait_AggregationPhase_MIN substrait_AggregationPhase_AGGREGATION_PHASE_UNSPECIFIED -#define _substrait_AggregationPhase_MAX substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT -#define _substrait_AggregationPhase_ARRAYSIZE ((substrait_AggregationPhase)(substrait_AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT+1)) - -#define _substrait_SortField_SortDirection_MIN substrait_SortField_SortDirection_SORT_DIRECTION_UNSPECIFIED -#define _substrait_SortField_SortDirection_MAX substrait_SortField_SortDirection_SORT_DIRECTION_CLUSTERED -#define _substrait_SortField_SortDirection_ARRAYSIZE ((substrait_SortField_SortDirection)(substrait_SortField_SortDirection_SORT_DIRECTION_CLUSTERED+1)) - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define substrait_Expression_init_default {0, {NULL}} -#define substrait_Expression_Enum_init_default {0, {NULL}} -#define substrait_Expression_Enum_Empty_init_default {0} -#define substrait_Expression_Literal_init_default {0, {NULL}, NULL} -#define substrait_Expression_Literal_VarChar_init_default {NULL, NULL} -#define substrait_Expression_Literal_Decimal_init_default {NULL, NULL, NULL} -#define substrait_Expression_Literal_Map_init_default {0, NULL} -#define substrait_Expression_Literal_Map_KeyValue_init_default {NULL, NULL} -#define substrait_Expression_Literal_IntervalYearToMonth_init_default {NULL, NULL} -#define substrait_Expression_Literal_IntervalDayToSecond_init_default {NULL, NULL} -#define substrait_Expression_Literal_Struct_init_default {0, NULL} -#define substrait_Expression_Literal_List_init_default {0, NULL} -#define substrait_Expression_ScalarFunction_init_default {NULL, 0, NULL, NULL} -#define substrait_Expression_WindowFunction_init_default {NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL} -#define substrait_Expression_WindowFunction_Bound_init_default {0, {NULL}} -#define substrait_Expression_WindowFunction_Bound_Preceding_init_default {NULL} -#define substrait_Expression_WindowFunction_Bound_Following_init_default {NULL} -#define substrait_Expression_WindowFunction_Bound_CurrentRow_init_default {0} -#define substrait_Expression_WindowFunction_Bound_Unbounded_init_default {0} -#define substrait_Expression_IfThen_init_default {0, NULL, NULL} -#define substrait_Expression_IfThen_IfClause_init_default {NULL, NULL} -#define substrait_Expression_Cast_init_default {NULL, NULL} -#define substrait_Expression_SwitchExpression_init_default {0, NULL, NULL} -#define substrait_Expression_SwitchExpression_IfValue_init_default {NULL, NULL} -#define substrait_Expression_SingularOrList_init_default {NULL, 0, NULL} -#define substrait_Expression_MultiOrList_init_default {0, NULL, 0, NULL} -#define substrait_Expression_MultiOrList_Record_init_default {0, NULL} -#define substrait_Expression_EmbeddedFunction_init_default {0, NULL, NULL, 0, {NULL}} -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_init_default {NULL, 0, NULL} -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_init_default {NULL, 0, NULL} -#define substrait_Expression_ReferenceSegment_init_default {0, {NULL}} -#define substrait_Expression_ReferenceSegment_MapKey_init_default {NULL, NULL} -#define substrait_Expression_ReferenceSegment_StructField_init_default {NULL, NULL} -#define substrait_Expression_ReferenceSegment_ListElement_init_default {NULL, NULL} -#define substrait_Expression_MaskExpression_init_default {NULL, NULL} -#define substrait_Expression_MaskExpression_Select_init_default {0, {NULL}} -#define substrait_Expression_MaskExpression_StructSelect_init_default {0, NULL} -#define substrait_Expression_MaskExpression_StructItem_init_default {NULL, NULL} -#define substrait_Expression_MaskExpression_ListSelect_init_default {0, NULL, NULL} -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_init_default {0, {NULL}} -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_init_default {NULL} -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_init_default {NULL, NULL} -#define substrait_Expression_MaskExpression_MapSelect_init_default {0, {NULL}, NULL} -#define substrait_Expression_MaskExpression_MapSelect_MapKey_init_default {NULL} -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_init_default {NULL} -#define substrait_Expression_FieldReference_init_default {0, {NULL}, 0, {NULL}} -#define substrait_Expression_FieldReference_RootReference_init_default {0} -#define substrait_SortField_init_default {NULL, 0, {NULL}} -#define substrait_AggregateFunction_init_default {NULL, 0, NULL, 0, NULL, NULL, NULL} -#define substrait_Expression_init_zero {0, {NULL}} -#define substrait_Expression_Enum_init_zero {0, {NULL}} -#define substrait_Expression_Enum_Empty_init_zero {0} -#define substrait_Expression_Literal_init_zero {0, {NULL}, NULL} -#define substrait_Expression_Literal_VarChar_init_zero {NULL, NULL} -#define substrait_Expression_Literal_Decimal_init_zero {NULL, NULL, NULL} -#define substrait_Expression_Literal_Map_init_zero {0, NULL} -#define substrait_Expression_Literal_Map_KeyValue_init_zero {NULL, NULL} -#define substrait_Expression_Literal_IntervalYearToMonth_init_zero {NULL, NULL} -#define substrait_Expression_Literal_IntervalDayToSecond_init_zero {NULL, NULL} -#define substrait_Expression_Literal_Struct_init_zero {0, NULL} -#define substrait_Expression_Literal_List_init_zero {0, NULL} -#define substrait_Expression_ScalarFunction_init_zero {NULL, 0, NULL, NULL} -#define substrait_Expression_WindowFunction_init_zero {NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL} -#define substrait_Expression_WindowFunction_Bound_init_zero {0, {NULL}} -#define substrait_Expression_WindowFunction_Bound_Preceding_init_zero {NULL} -#define substrait_Expression_WindowFunction_Bound_Following_init_zero {NULL} -#define substrait_Expression_WindowFunction_Bound_CurrentRow_init_zero {0} -#define substrait_Expression_WindowFunction_Bound_Unbounded_init_zero {0} -#define substrait_Expression_IfThen_init_zero {0, NULL, NULL} -#define substrait_Expression_IfThen_IfClause_init_zero {NULL, NULL} -#define substrait_Expression_Cast_init_zero {NULL, NULL} -#define substrait_Expression_SwitchExpression_init_zero {0, NULL, NULL} -#define substrait_Expression_SwitchExpression_IfValue_init_zero {NULL, NULL} -#define substrait_Expression_SingularOrList_init_zero {NULL, 0, NULL} -#define substrait_Expression_MultiOrList_init_zero {0, NULL, 0, NULL} -#define substrait_Expression_MultiOrList_Record_init_zero {0, NULL} -#define substrait_Expression_EmbeddedFunction_init_zero {0, NULL, NULL, 0, {NULL}} -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_init_zero {NULL, 0, NULL} -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_init_zero {NULL, 0, NULL} -#define substrait_Expression_ReferenceSegment_init_zero {0, {NULL}} -#define substrait_Expression_ReferenceSegment_MapKey_init_zero {NULL, NULL} -#define substrait_Expression_ReferenceSegment_StructField_init_zero {NULL, NULL} -#define substrait_Expression_ReferenceSegment_ListElement_init_zero {NULL, NULL} -#define substrait_Expression_MaskExpression_init_zero {NULL, NULL} -#define substrait_Expression_MaskExpression_Select_init_zero {0, {NULL}} -#define substrait_Expression_MaskExpression_StructSelect_init_zero {0, NULL} -#define substrait_Expression_MaskExpression_StructItem_init_zero {NULL, NULL} -#define substrait_Expression_MaskExpression_ListSelect_init_zero {0, NULL, NULL} -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_init_zero {0, {NULL}} -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_init_zero {NULL} -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_init_zero {NULL, NULL} -#define substrait_Expression_MaskExpression_MapSelect_init_zero {0, {NULL}, NULL} -#define substrait_Expression_MaskExpression_MapSelect_MapKey_init_zero {NULL} -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_init_zero {NULL} -#define substrait_Expression_FieldReference_init_zero {0, {NULL}, 0, {NULL}} -#define substrait_Expression_FieldReference_RootReference_init_zero {0} -#define substrait_SortField_init_zero {NULL, 0, {NULL}} -#define substrait_AggregateFunction_init_zero {NULL, 0, NULL, 0, NULL, NULL, NULL} - -/* Field tags (for use in manual encoding/decoding) */ -#define substrait_AggregateFunction_function_reference_tag 1 -#define substrait_AggregateFunction_args_tag 2 -#define substrait_AggregateFunction_sorts_tag 3 -#define substrait_AggregateFunction_phase_tag 4 -#define substrait_AggregateFunction_output_type_tag 5 -#define substrait_Expression_literal_tag 1 -#define substrait_Expression_selection_tag 2 -#define substrait_Expression_scalar_function_tag 3 -#define substrait_Expression_window_function_tag 5 -#define substrait_Expression_if_then_tag 6 -#define substrait_Expression_switch_expression_tag 7 -#define substrait_Expression_singular_or_list_tag 8 -#define substrait_Expression_multi_or_list_tag 9 -#define substrait_Expression_enum__tag 10 -#define substrait_Expression_cast_tag 11 -#define substrait_Expression_Cast_type_tag 1 -#define substrait_Expression_Cast_input_tag 2 -#define substrait_Expression_EmbeddedFunction_arguments_tag 1 -#define substrait_Expression_EmbeddedFunction_output_type_tag 2 -#define substrait_Expression_EmbeddedFunction_python_pickle_function_tag 3 -#define substrait_Expression_EmbeddedFunction_web_assembly_function_tag 4 -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_function__tag 1 -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_prerequisite_tag 2 -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_script_tag 1 -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_prerequisite_tag 2 -#define substrait_Expression_Enum_specified_tag 1 -#define substrait_Expression_Enum_unspecified_tag 2 -#define substrait_Expression_FieldReference_direct_reference_tag 1 -#define substrait_Expression_FieldReference_masked_reference_tag 2 -#define substrait_Expression_FieldReference_expression_tag 3 -#define substrait_Expression_FieldReference_root_reference_tag 4 -#define substrait_Expression_IfThen_ifs_tag 1 -#define substrait_Expression_IfThen_else__tag 2 -#define substrait_Expression_IfThen_IfClause_if__tag 1 -#define substrait_Expression_IfThen_IfClause_then_tag 2 -#define substrait_Expression_Literal_boolean_tag 1 -#define substrait_Expression_Literal_i8_tag 2 -#define substrait_Expression_Literal_i16_tag 3 -#define substrait_Expression_Literal_i32_tag 5 -#define substrait_Expression_Literal_i64_tag 7 -#define substrait_Expression_Literal_fp32_tag 10 -#define substrait_Expression_Literal_fp64_tag 11 -#define substrait_Expression_Literal_string_tag 12 -#define substrait_Expression_Literal_binary_tag 13 -#define substrait_Expression_Literal_timestamp_tag 14 -#define substrait_Expression_Literal_date_tag 16 -#define substrait_Expression_Literal_time_tag 17 -#define substrait_Expression_Literal_interval_year_to_month_tag 19 -#define substrait_Expression_Literal_interval_day_to_second_tag 20 -#define substrait_Expression_Literal_fixed_char_tag 21 -#define substrait_Expression_Literal_var_char_tag 22 -#define substrait_Expression_Literal_fixed_binary_tag 23 -#define substrait_Expression_Literal_decimal_tag 24 -#define substrait_Expression_Literal_struct__tag 25 -#define substrait_Expression_Literal_map_tag 26 -#define substrait_Expression_Literal_timestamp_tz_tag 27 -#define substrait_Expression_Literal_uuid_tag 28 -#define substrait_Expression_Literal_null_tag 29 -#define substrait_Expression_Literal_list_tag 30 -#define substrait_Expression_Literal_empty_list_tag 31 -#define substrait_Expression_Literal_empty_map_tag 32 -#define substrait_Expression_Literal_nullable_tag 50 -#define substrait_Expression_Literal_Decimal_value_tag 1 -#define substrait_Expression_Literal_Decimal_precision_tag 2 -#define substrait_Expression_Literal_Decimal_scale_tag 3 -#define substrait_Expression_Literal_IntervalDayToSecond_days_tag 1 -#define substrait_Expression_Literal_IntervalDayToSecond_seconds_tag 2 -#define substrait_Expression_Literal_IntervalYearToMonth_years_tag 1 -#define substrait_Expression_Literal_IntervalYearToMonth_months_tag 2 -#define substrait_Expression_Literal_List_values_tag 1 -#define substrait_Expression_Literal_Map_key_values_tag 1 -#define substrait_Expression_Literal_Map_KeyValue_key_tag 1 -#define substrait_Expression_Literal_Map_KeyValue_value_tag 2 -#define substrait_Expression_Literal_Struct_fields_tag 1 -#define substrait_Expression_Literal_VarChar_value_tag 1 -#define substrait_Expression_Literal_VarChar_length_tag 2 -#define substrait_Expression_MaskExpression_select_tag 1 -#define substrait_Expression_MaskExpression_maintain_singular_struct_tag 2 -#define substrait_Expression_MaskExpression_ListSelect_selection_tag 1 -#define substrait_Expression_MaskExpression_ListSelect_child_tag 2 -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_item_tag 1 -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_slice_tag 2 -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_field_tag 1 -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_start_tag 1 -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_end_tag 2 -#define substrait_Expression_MaskExpression_MapSelect_key_tag 1 -#define substrait_Expression_MaskExpression_MapSelect_expression_tag 2 -#define substrait_Expression_MaskExpression_MapSelect_child_tag 3 -#define substrait_Expression_MaskExpression_MapSelect_MapKey_map_key_tag 1 -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_map_key_expression_tag 1 -#define substrait_Expression_MaskExpression_Select_struct__tag 1 -#define substrait_Expression_MaskExpression_Select_list_tag 2 -#define substrait_Expression_MaskExpression_Select_map_tag 3 -#define substrait_Expression_MaskExpression_StructItem_field_tag 1 -#define substrait_Expression_MaskExpression_StructItem_child_tag 2 -#define substrait_Expression_MaskExpression_StructSelect_struct_items_tag 1 -#define substrait_Expression_MultiOrList_value_tag 1 -#define substrait_Expression_MultiOrList_options_tag 2 -#define substrait_Expression_MultiOrList_Record_fields_tag 1 -#define substrait_Expression_ReferenceSegment_map_key_tag 1 -#define substrait_Expression_ReferenceSegment_struct_field_tag 2 -#define substrait_Expression_ReferenceSegment_list_element_tag 3 -#define substrait_Expression_ReferenceSegment_ListElement_offset_tag 1 -#define substrait_Expression_ReferenceSegment_ListElement_child_tag 2 -#define substrait_Expression_ReferenceSegment_MapKey_map_key_tag 1 -#define substrait_Expression_ReferenceSegment_MapKey_child_tag 2 -#define substrait_Expression_ReferenceSegment_StructField_field_tag 1 -#define substrait_Expression_ReferenceSegment_StructField_child_tag 2 -#define substrait_Expression_ScalarFunction_function_reference_tag 1 -#define substrait_Expression_ScalarFunction_args_tag 2 -#define substrait_Expression_ScalarFunction_output_type_tag 3 -#define substrait_Expression_SingularOrList_value_tag 1 -#define substrait_Expression_SingularOrList_options_tag 2 -#define substrait_Expression_SwitchExpression_ifs_tag 1 -#define substrait_Expression_SwitchExpression_else__tag 2 -#define substrait_Expression_SwitchExpression_IfValue_if__tag 1 -#define substrait_Expression_SwitchExpression_IfValue_then_tag 2 -#define substrait_Expression_WindowFunction_function_reference_tag 1 -#define substrait_Expression_WindowFunction_partitions_tag 2 -#define substrait_Expression_WindowFunction_sorts_tag 3 -#define substrait_Expression_WindowFunction_upper_bound_tag 4 -#define substrait_Expression_WindowFunction_lower_bound_tag 5 -#define substrait_Expression_WindowFunction_phase_tag 6 -#define substrait_Expression_WindowFunction_output_type_tag 7 -#define substrait_Expression_WindowFunction_args_tag 8 -#define substrait_Expression_WindowFunction_Bound_preceding_tag 1 -#define substrait_Expression_WindowFunction_Bound_following_tag 2 -#define substrait_Expression_WindowFunction_Bound_current_row_tag 3 -#define substrait_Expression_WindowFunction_Bound_unbounded_tag 4 -#define substrait_Expression_WindowFunction_Bound_Following_offset_tag 1 -#define substrait_Expression_WindowFunction_Bound_Preceding_offset_tag 1 -#define substrait_SortField_expr_tag 1 -#define substrait_SortField_direction_tag 2 -#define substrait_SortField_comparison_function_reference_tag 3 - -/* Struct field encoding specification for nanopb */ -#define substrait_Expression_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,literal,rex_type.literal), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,selection,rex_type.selection), 2) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,scalar_function,rex_type.scalar_function), 3) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,window_function,rex_type.window_function), 5) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,if_then,rex_type.if_then), 6) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,switch_expression,rex_type.switch_expression), 7) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,singular_or_list,rex_type.singular_or_list), 8) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,multi_or_list,rex_type.multi_or_list), 9) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,enum_,rex_type.enum_), 10) \ -X(a, POINTER, ONEOF, MESSAGE, (rex_type,cast,rex_type.cast), 11) -#define substrait_Expression_CALLBACK NULL -#define substrait_Expression_DEFAULT NULL -#define substrait_Expression_rex_type_literal_MSGTYPE substrait_Expression_Literal -#define substrait_Expression_rex_type_selection_MSGTYPE substrait_Expression_FieldReference -#define substrait_Expression_rex_type_scalar_function_MSGTYPE substrait_Expression_ScalarFunction -#define substrait_Expression_rex_type_window_function_MSGTYPE substrait_Expression_WindowFunction -#define substrait_Expression_rex_type_if_then_MSGTYPE substrait_Expression_IfThen -#define substrait_Expression_rex_type_switch_expression_MSGTYPE substrait_Expression_SwitchExpression -#define substrait_Expression_rex_type_singular_or_list_MSGTYPE substrait_Expression_SingularOrList -#define substrait_Expression_rex_type_multi_or_list_MSGTYPE substrait_Expression_MultiOrList -#define substrait_Expression_rex_type_enum__MSGTYPE substrait_Expression_Enum -#define substrait_Expression_rex_type_cast_MSGTYPE substrait_Expression_Cast - -#define substrait_Expression_Enum_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, STRING, (enum_kind,specified,enum_kind.specified), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (enum_kind,unspecified,enum_kind.unspecified), 2) -#define substrait_Expression_Enum_CALLBACK NULL -#define substrait_Expression_Enum_DEFAULT NULL -#define substrait_Expression_Enum_enum_kind_unspecified_MSGTYPE substrait_Expression_Enum_Empty - -#define substrait_Expression_Enum_Empty_FIELDLIST(X, a) \ - -#define substrait_Expression_Enum_Empty_CALLBACK NULL -#define substrait_Expression_Enum_Empty_DEFAULT NULL - -#define substrait_Expression_Literal_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, BOOL, (literal_type,boolean,literal_type.boolean), 1) \ -X(a, POINTER, ONEOF, INT32, (literal_type,i8,literal_type.i8), 2) \ -X(a, POINTER, ONEOF, INT32, (literal_type,i16,literal_type.i16), 3) \ -X(a, POINTER, ONEOF, INT32, (literal_type,i32,literal_type.i32), 5) \ -X(a, POINTER, ONEOF, INT64, (literal_type,i64,literal_type.i64), 7) \ -X(a, POINTER, ONEOF, FLOAT, (literal_type,fp32,literal_type.fp32), 10) \ -X(a, POINTER, ONEOF, DOUBLE, (literal_type,fp64,literal_type.fp64), 11) \ -X(a, POINTER, ONEOF, STRING, (literal_type,string,literal_type.string), 12) \ -X(a, POINTER, ONEOF, BYTES, (literal_type,binary,literal_type.binary), 13) \ -X(a, POINTER, ONEOF, INT64, (literal_type,timestamp,literal_type.timestamp), 14) \ -X(a, POINTER, ONEOF, INT32, (literal_type,date,literal_type.date), 16) \ -X(a, POINTER, ONEOF, INT64, (literal_type,time,literal_type.time), 17) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,interval_year_to_month,literal_type.interval_year_to_month), 19) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,interval_day_to_second,literal_type.interval_day_to_second), 20) \ -X(a, POINTER, ONEOF, STRING, (literal_type,fixed_char,literal_type.fixed_char), 21) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,var_char,literal_type.var_char), 22) \ -X(a, POINTER, ONEOF, BYTES, (literal_type,fixed_binary,literal_type.fixed_binary), 23) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,decimal,literal_type.decimal), 24) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,struct_,literal_type.struct_), 25) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,map,literal_type.map), 26) \ -X(a, POINTER, ONEOF, INT64, (literal_type,timestamp_tz,literal_type.timestamp_tz), 27) \ -X(a, POINTER, ONEOF, BYTES, (literal_type,uuid,literal_type.uuid), 28) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,null,literal_type.null), 29) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,list,literal_type.list), 30) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,empty_list,literal_type.empty_list), 31) \ -X(a, POINTER, ONEOF, MESSAGE, (literal_type,empty_map,literal_type.empty_map), 32) \ -X(a, POINTER, SINGULAR, BOOL, nullable, 50) -#define substrait_Expression_Literal_CALLBACK NULL -#define substrait_Expression_Literal_DEFAULT NULL -#define substrait_Expression_Literal_literal_type_interval_year_to_month_MSGTYPE substrait_Expression_Literal_IntervalYearToMonth -#define substrait_Expression_Literal_literal_type_interval_day_to_second_MSGTYPE substrait_Expression_Literal_IntervalDayToSecond -#define substrait_Expression_Literal_literal_type_var_char_MSGTYPE substrait_Expression_Literal_VarChar -#define substrait_Expression_Literal_literal_type_decimal_MSGTYPE substrait_Expression_Literal_Decimal -#define substrait_Expression_Literal_literal_type_struct__MSGTYPE substrait_Expression_Literal_Struct -#define substrait_Expression_Literal_literal_type_map_MSGTYPE substrait_Expression_Literal_Map -#define substrait_Expression_Literal_literal_type_null_MSGTYPE substrait_Type -#define substrait_Expression_Literal_literal_type_list_MSGTYPE substrait_Expression_Literal_List -#define substrait_Expression_Literal_literal_type_empty_list_MSGTYPE substrait_Type_List -#define substrait_Expression_Literal_literal_type_empty_map_MSGTYPE substrait_Type_Map - -#define substrait_Expression_Literal_VarChar_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, STRING, value, 1) \ -X(a, POINTER, SINGULAR, UINT32, length, 2) -#define substrait_Expression_Literal_VarChar_CALLBACK NULL -#define substrait_Expression_Literal_VarChar_DEFAULT NULL - -#define substrait_Expression_Literal_Decimal_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, BYTES, value, 1) \ -X(a, POINTER, SINGULAR, INT32, precision, 2) \ -X(a, POINTER, SINGULAR, INT32, scale, 3) -#define substrait_Expression_Literal_Decimal_CALLBACK NULL -#define substrait_Expression_Literal_Decimal_DEFAULT NULL - -#define substrait_Expression_Literal_Map_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, key_values, 1) -#define substrait_Expression_Literal_Map_CALLBACK NULL -#define substrait_Expression_Literal_Map_DEFAULT NULL -#define substrait_Expression_Literal_Map_key_values_MSGTYPE substrait_Expression_Literal_Map_KeyValue - -#define substrait_Expression_Literal_Map_KeyValue_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, key, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, value, 2) -#define substrait_Expression_Literal_Map_KeyValue_CALLBACK NULL -#define substrait_Expression_Literal_Map_KeyValue_DEFAULT NULL -#define substrait_Expression_Literal_Map_KeyValue_key_MSGTYPE substrait_Expression_Literal -#define substrait_Expression_Literal_Map_KeyValue_value_MSGTYPE substrait_Expression_Literal - -#define substrait_Expression_Literal_IntervalYearToMonth_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, years, 1) \ -X(a, POINTER, SINGULAR, INT32, months, 2) -#define substrait_Expression_Literal_IntervalYearToMonth_CALLBACK NULL -#define substrait_Expression_Literal_IntervalYearToMonth_DEFAULT NULL - -#define substrait_Expression_Literal_IntervalDayToSecond_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, days, 1) \ -X(a, POINTER, SINGULAR, INT32, seconds, 2) -#define substrait_Expression_Literal_IntervalDayToSecond_CALLBACK NULL -#define substrait_Expression_Literal_IntervalDayToSecond_DEFAULT NULL - -#define substrait_Expression_Literal_Struct_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, fields, 1) -#define substrait_Expression_Literal_Struct_CALLBACK NULL -#define substrait_Expression_Literal_Struct_DEFAULT NULL -#define substrait_Expression_Literal_Struct_fields_MSGTYPE substrait_Expression_Literal - -#define substrait_Expression_Literal_List_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, values, 1) -#define substrait_Expression_Literal_List_CALLBACK NULL -#define substrait_Expression_Literal_List_DEFAULT NULL -#define substrait_Expression_Literal_List_values_MSGTYPE substrait_Expression_Literal - -#define substrait_Expression_ScalarFunction_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, UINT32, function_reference, 1) \ -X(a, POINTER, REPEATED, MESSAGE, args, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, output_type, 3) -#define substrait_Expression_ScalarFunction_CALLBACK NULL -#define substrait_Expression_ScalarFunction_DEFAULT NULL -#define substrait_Expression_ScalarFunction_args_MSGTYPE substrait_Expression -#define substrait_Expression_ScalarFunction_output_type_MSGTYPE substrait_Type - -#define substrait_Expression_WindowFunction_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, UINT32, function_reference, 1) \ -X(a, POINTER, REPEATED, MESSAGE, partitions, 2) \ -X(a, POINTER, REPEATED, MESSAGE, sorts, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, upper_bound, 4) \ -X(a, POINTER, OPTIONAL, MESSAGE, lower_bound, 5) \ -X(a, POINTER, SINGULAR, UENUM, phase, 6) \ -X(a, POINTER, OPTIONAL, MESSAGE, output_type, 7) \ -X(a, POINTER, REPEATED, MESSAGE, args, 8) -#define substrait_Expression_WindowFunction_CALLBACK NULL -#define substrait_Expression_WindowFunction_DEFAULT NULL -#define substrait_Expression_WindowFunction_partitions_MSGTYPE substrait_Expression -#define substrait_Expression_WindowFunction_sorts_MSGTYPE substrait_SortField -#define substrait_Expression_WindowFunction_upper_bound_MSGTYPE substrait_Expression_WindowFunction_Bound -#define substrait_Expression_WindowFunction_lower_bound_MSGTYPE substrait_Expression_WindowFunction_Bound -#define substrait_Expression_WindowFunction_output_type_MSGTYPE substrait_Type -#define substrait_Expression_WindowFunction_args_MSGTYPE substrait_Expression - -#define substrait_Expression_WindowFunction_Bound_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,preceding,kind.preceding), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,following,kind.following), 2) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,current_row,kind.current_row), 3) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,unbounded,kind.unbounded), 4) -#define substrait_Expression_WindowFunction_Bound_CALLBACK NULL -#define substrait_Expression_WindowFunction_Bound_DEFAULT NULL -#define substrait_Expression_WindowFunction_Bound_kind_preceding_MSGTYPE substrait_Expression_WindowFunction_Bound_Preceding -#define substrait_Expression_WindowFunction_Bound_kind_following_MSGTYPE substrait_Expression_WindowFunction_Bound_Following -#define substrait_Expression_WindowFunction_Bound_kind_current_row_MSGTYPE substrait_Expression_WindowFunction_Bound_CurrentRow -#define substrait_Expression_WindowFunction_Bound_kind_unbounded_MSGTYPE substrait_Expression_WindowFunction_Bound_Unbounded - -#define substrait_Expression_WindowFunction_Bound_Preceding_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT64, offset, 1) -#define substrait_Expression_WindowFunction_Bound_Preceding_CALLBACK NULL -#define substrait_Expression_WindowFunction_Bound_Preceding_DEFAULT NULL - -#define substrait_Expression_WindowFunction_Bound_Following_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT64, offset, 1) -#define substrait_Expression_WindowFunction_Bound_Following_CALLBACK NULL -#define substrait_Expression_WindowFunction_Bound_Following_DEFAULT NULL - -#define substrait_Expression_WindowFunction_Bound_CurrentRow_FIELDLIST(X, a) \ - -#define substrait_Expression_WindowFunction_Bound_CurrentRow_CALLBACK NULL -#define substrait_Expression_WindowFunction_Bound_CurrentRow_DEFAULT NULL - -#define substrait_Expression_WindowFunction_Bound_Unbounded_FIELDLIST(X, a) \ - -#define substrait_Expression_WindowFunction_Bound_Unbounded_CALLBACK NULL -#define substrait_Expression_WindowFunction_Bound_Unbounded_DEFAULT NULL - -#define substrait_Expression_IfThen_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, ifs, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, else_, 2) -#define substrait_Expression_IfThen_CALLBACK NULL -#define substrait_Expression_IfThen_DEFAULT NULL -#define substrait_Expression_IfThen_ifs_MSGTYPE substrait_Expression_IfThen_IfClause -#define substrait_Expression_IfThen_else__MSGTYPE substrait_Expression - -#define substrait_Expression_IfThen_IfClause_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, if_, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, then, 2) -#define substrait_Expression_IfThen_IfClause_CALLBACK NULL -#define substrait_Expression_IfThen_IfClause_DEFAULT NULL -#define substrait_Expression_IfThen_IfClause_if__MSGTYPE substrait_Expression -#define substrait_Expression_IfThen_IfClause_then_MSGTYPE substrait_Expression - -#define substrait_Expression_Cast_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, type, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) -#define substrait_Expression_Cast_CALLBACK NULL -#define substrait_Expression_Cast_DEFAULT NULL -#define substrait_Expression_Cast_type_MSGTYPE substrait_Type -#define substrait_Expression_Cast_input_MSGTYPE substrait_Expression - -#define substrait_Expression_SwitchExpression_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, ifs, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, else_, 2) -#define substrait_Expression_SwitchExpression_CALLBACK NULL -#define substrait_Expression_SwitchExpression_DEFAULT NULL -#define substrait_Expression_SwitchExpression_ifs_MSGTYPE substrait_Expression_SwitchExpression_IfValue -#define substrait_Expression_SwitchExpression_else__MSGTYPE substrait_Expression - -#define substrait_Expression_SwitchExpression_IfValue_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, if_, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, then, 2) -#define substrait_Expression_SwitchExpression_IfValue_CALLBACK NULL -#define substrait_Expression_SwitchExpression_IfValue_DEFAULT NULL -#define substrait_Expression_SwitchExpression_IfValue_if__MSGTYPE substrait_Expression_Literal -#define substrait_Expression_SwitchExpression_IfValue_then_MSGTYPE substrait_Expression - -#define substrait_Expression_SingularOrList_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, value, 1) \ -X(a, POINTER, REPEATED, MESSAGE, options, 2) -#define substrait_Expression_SingularOrList_CALLBACK NULL -#define substrait_Expression_SingularOrList_DEFAULT NULL -#define substrait_Expression_SingularOrList_value_MSGTYPE substrait_Expression -#define substrait_Expression_SingularOrList_options_MSGTYPE substrait_Expression - -#define substrait_Expression_MultiOrList_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, value, 1) \ -X(a, POINTER, REPEATED, MESSAGE, options, 2) -#define substrait_Expression_MultiOrList_CALLBACK NULL -#define substrait_Expression_MultiOrList_DEFAULT NULL -#define substrait_Expression_MultiOrList_value_MSGTYPE substrait_Expression -#define substrait_Expression_MultiOrList_options_MSGTYPE substrait_Expression_MultiOrList_Record - -#define substrait_Expression_MultiOrList_Record_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, fields, 1) -#define substrait_Expression_MultiOrList_Record_CALLBACK NULL -#define substrait_Expression_MultiOrList_Record_DEFAULT NULL -#define substrait_Expression_MultiOrList_Record_fields_MSGTYPE substrait_Expression - -#define substrait_Expression_EmbeddedFunction_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, arguments, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, output_type, 2) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,python_pickle_function,kind.python_pickle_function), 3) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,web_assembly_function,kind.web_assembly_function), 4) -#define substrait_Expression_EmbeddedFunction_CALLBACK NULL -#define substrait_Expression_EmbeddedFunction_DEFAULT NULL -#define substrait_Expression_EmbeddedFunction_arguments_MSGTYPE substrait_Expression -#define substrait_Expression_EmbeddedFunction_output_type_MSGTYPE substrait_Type -#define substrait_Expression_EmbeddedFunction_kind_python_pickle_function_MSGTYPE substrait_Expression_EmbeddedFunction_PythonPickleFunction -#define substrait_Expression_EmbeddedFunction_kind_web_assembly_function_MSGTYPE substrait_Expression_EmbeddedFunction_WebAssemblyFunction - -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, BYTES, function_, 1) \ -X(a, POINTER, REPEATED, STRING, prerequisite, 2) -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_CALLBACK NULL -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_DEFAULT NULL - -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, BYTES, script, 1) \ -X(a, POINTER, REPEATED, STRING, prerequisite, 2) -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_CALLBACK NULL -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_DEFAULT NULL - -#define substrait_Expression_ReferenceSegment_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (reference_type,map_key,reference_type.map_key), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (reference_type,struct_field,reference_type.struct_field), 2) \ -X(a, POINTER, ONEOF, MESSAGE, (reference_type,list_element,reference_type.list_element), 3) -#define substrait_Expression_ReferenceSegment_CALLBACK NULL -#define substrait_Expression_ReferenceSegment_DEFAULT NULL -#define substrait_Expression_ReferenceSegment_reference_type_map_key_MSGTYPE substrait_Expression_ReferenceSegment_MapKey -#define substrait_Expression_ReferenceSegment_reference_type_struct_field_MSGTYPE substrait_Expression_ReferenceSegment_StructField -#define substrait_Expression_ReferenceSegment_reference_type_list_element_MSGTYPE substrait_Expression_ReferenceSegment_ListElement - -#define substrait_Expression_ReferenceSegment_MapKey_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, map_key, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, child, 2) -#define substrait_Expression_ReferenceSegment_MapKey_CALLBACK NULL -#define substrait_Expression_ReferenceSegment_MapKey_DEFAULT NULL -#define substrait_Expression_ReferenceSegment_MapKey_map_key_MSGTYPE substrait_Expression_Literal -#define substrait_Expression_ReferenceSegment_MapKey_child_MSGTYPE substrait_Expression_ReferenceSegment - -#define substrait_Expression_ReferenceSegment_StructField_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, field, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, child, 2) -#define substrait_Expression_ReferenceSegment_StructField_CALLBACK NULL -#define substrait_Expression_ReferenceSegment_StructField_DEFAULT NULL -#define substrait_Expression_ReferenceSegment_StructField_child_MSGTYPE substrait_Expression_ReferenceSegment - -#define substrait_Expression_ReferenceSegment_ListElement_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, offset, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, child, 2) -#define substrait_Expression_ReferenceSegment_ListElement_CALLBACK NULL -#define substrait_Expression_ReferenceSegment_ListElement_DEFAULT NULL -#define substrait_Expression_ReferenceSegment_ListElement_child_MSGTYPE substrait_Expression_ReferenceSegment - -#define substrait_Expression_MaskExpression_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, select, 1) \ -X(a, POINTER, SINGULAR, BOOL, maintain_singular_struct, 2) -#define substrait_Expression_MaskExpression_CALLBACK NULL -#define substrait_Expression_MaskExpression_DEFAULT NULL -#define substrait_Expression_MaskExpression_select_MSGTYPE substrait_Expression_MaskExpression_StructSelect - -#define substrait_Expression_MaskExpression_Select_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (type,struct_,type.struct_), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (type,list,type.list), 2) \ -X(a, POINTER, ONEOF, MESSAGE, (type,map,type.map), 3) -#define substrait_Expression_MaskExpression_Select_CALLBACK NULL -#define substrait_Expression_MaskExpression_Select_DEFAULT NULL -#define substrait_Expression_MaskExpression_Select_type_struct__MSGTYPE substrait_Expression_MaskExpression_StructSelect -#define substrait_Expression_MaskExpression_Select_type_list_MSGTYPE substrait_Expression_MaskExpression_ListSelect -#define substrait_Expression_MaskExpression_Select_type_map_MSGTYPE substrait_Expression_MaskExpression_MapSelect - -#define substrait_Expression_MaskExpression_StructSelect_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, struct_items, 1) -#define substrait_Expression_MaskExpression_StructSelect_CALLBACK NULL -#define substrait_Expression_MaskExpression_StructSelect_DEFAULT NULL -#define substrait_Expression_MaskExpression_StructSelect_struct_items_MSGTYPE substrait_Expression_MaskExpression_StructItem - -#define substrait_Expression_MaskExpression_StructItem_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, field, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, child, 2) -#define substrait_Expression_MaskExpression_StructItem_CALLBACK NULL -#define substrait_Expression_MaskExpression_StructItem_DEFAULT NULL -#define substrait_Expression_MaskExpression_StructItem_child_MSGTYPE substrait_Expression_MaskExpression_Select - -#define substrait_Expression_MaskExpression_ListSelect_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, selection, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, child, 2) -#define substrait_Expression_MaskExpression_ListSelect_CALLBACK NULL -#define substrait_Expression_MaskExpression_ListSelect_DEFAULT NULL -#define substrait_Expression_MaskExpression_ListSelect_selection_MSGTYPE substrait_Expression_MaskExpression_ListSelect_ListSelectItem -#define substrait_Expression_MaskExpression_ListSelect_child_MSGTYPE substrait_Expression_MaskExpression_Select - -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (type,item,type.item), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (type,slice,type.slice), 2) -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_CALLBACK NULL -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_DEFAULT NULL -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_type_item_MSGTYPE substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_type_slice_MSGTYPE substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice - -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, field, 1) -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_CALLBACK NULL -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_DEFAULT NULL - -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, INT32, start, 1) \ -X(a, POINTER, SINGULAR, INT32, end, 2) -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_CALLBACK NULL -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_DEFAULT NULL - -#define substrait_Expression_MaskExpression_MapSelect_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (select,key,select.key), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (select,expression,select.expression), 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, child, 3) -#define substrait_Expression_MaskExpression_MapSelect_CALLBACK NULL -#define substrait_Expression_MaskExpression_MapSelect_DEFAULT NULL -#define substrait_Expression_MaskExpression_MapSelect_select_key_MSGTYPE substrait_Expression_MaskExpression_MapSelect_MapKey -#define substrait_Expression_MaskExpression_MapSelect_select_expression_MSGTYPE substrait_Expression_MaskExpression_MapSelect_MapKeyExpression -#define substrait_Expression_MaskExpression_MapSelect_child_MSGTYPE substrait_Expression_MaskExpression_Select - -#define substrait_Expression_MaskExpression_MapSelect_MapKey_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, STRING, map_key, 1) -#define substrait_Expression_MaskExpression_MapSelect_MapKey_CALLBACK NULL -#define substrait_Expression_MaskExpression_MapSelect_MapKey_DEFAULT NULL - -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, STRING, map_key_expression, 1) -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_CALLBACK NULL -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_DEFAULT NULL - -#define substrait_Expression_FieldReference_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (reference_type,direct_reference,reference_type.direct_reference), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (reference_type,masked_reference,reference_type.masked_reference), 2) \ -X(a, POINTER, ONEOF, MESSAGE, (root_type,expression,root_type.expression), 3) \ -X(a, POINTER, ONEOF, MESSAGE, (root_type,root_reference,root_type.root_reference), 4) -#define substrait_Expression_FieldReference_CALLBACK NULL -#define substrait_Expression_FieldReference_DEFAULT NULL -#define substrait_Expression_FieldReference_reference_type_direct_reference_MSGTYPE substrait_Expression_ReferenceSegment -#define substrait_Expression_FieldReference_reference_type_masked_reference_MSGTYPE substrait_Expression_MaskExpression -#define substrait_Expression_FieldReference_root_type_expression_MSGTYPE substrait_Expression -#define substrait_Expression_FieldReference_root_type_root_reference_MSGTYPE substrait_Expression_FieldReference_RootReference - -#define substrait_Expression_FieldReference_RootReference_FIELDLIST(X, a) \ - -#define substrait_Expression_FieldReference_RootReference_CALLBACK NULL -#define substrait_Expression_FieldReference_RootReference_DEFAULT NULL - -#define substrait_SortField_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, expr, 1) \ -X(a, POINTER, ONEOF, UENUM, (sort_kind,direction,sort_kind.direction), 2) \ -X(a, POINTER, ONEOF, UINT32, (sort_kind,comparison_function_reference,sort_kind.comparison_function_reference), 3) -#define substrait_SortField_CALLBACK NULL -#define substrait_SortField_DEFAULT NULL -#define substrait_SortField_expr_MSGTYPE substrait_Expression - -#define substrait_AggregateFunction_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, UINT32, function_reference, 1) \ -X(a, POINTER, REPEATED, MESSAGE, args, 2) \ -X(a, POINTER, REPEATED, MESSAGE, sorts, 3) \ -X(a, POINTER, SINGULAR, UENUM, phase, 4) \ -X(a, POINTER, OPTIONAL, MESSAGE, output_type, 5) -#define substrait_AggregateFunction_CALLBACK NULL -#define substrait_AggregateFunction_DEFAULT NULL -#define substrait_AggregateFunction_args_MSGTYPE substrait_Expression -#define substrait_AggregateFunction_sorts_MSGTYPE substrait_SortField -#define substrait_AggregateFunction_output_type_MSGTYPE substrait_Type - -extern const pb_msgdesc_t substrait_Expression_msg; -extern const pb_msgdesc_t substrait_Expression_Enum_msg; -extern const pb_msgdesc_t substrait_Expression_Enum_Empty_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_VarChar_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_Decimal_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_Map_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_Map_KeyValue_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_IntervalYearToMonth_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_IntervalDayToSecond_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_Struct_msg; -extern const pb_msgdesc_t substrait_Expression_Literal_List_msg; -extern const pb_msgdesc_t substrait_Expression_ScalarFunction_msg; -extern const pb_msgdesc_t substrait_Expression_WindowFunction_msg; -extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_msg; -extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_Preceding_msg; -extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_Following_msg; -extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_CurrentRow_msg; -extern const pb_msgdesc_t substrait_Expression_WindowFunction_Bound_Unbounded_msg; -extern const pb_msgdesc_t substrait_Expression_IfThen_msg; -extern const pb_msgdesc_t substrait_Expression_IfThen_IfClause_msg; -extern const pb_msgdesc_t substrait_Expression_Cast_msg; -extern const pb_msgdesc_t substrait_Expression_SwitchExpression_msg; -extern const pb_msgdesc_t substrait_Expression_SwitchExpression_IfValue_msg; -extern const pb_msgdesc_t substrait_Expression_SingularOrList_msg; -extern const pb_msgdesc_t substrait_Expression_MultiOrList_msg; -extern const pb_msgdesc_t substrait_Expression_MultiOrList_Record_msg; -extern const pb_msgdesc_t substrait_Expression_EmbeddedFunction_msg; -extern const pb_msgdesc_t substrait_Expression_EmbeddedFunction_PythonPickleFunction_msg; -extern const pb_msgdesc_t substrait_Expression_EmbeddedFunction_WebAssemblyFunction_msg; -extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_msg; -extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_MapKey_msg; -extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_StructField_msg; -extern const pb_msgdesc_t substrait_Expression_ReferenceSegment_ListElement_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_Select_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_StructSelect_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_StructItem_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_ListSelectItem_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_MapSelect_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_MapSelect_MapKey_msg; -extern const pb_msgdesc_t substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_msg; -extern const pb_msgdesc_t substrait_Expression_FieldReference_msg; -extern const pb_msgdesc_t substrait_Expression_FieldReference_RootReference_msg; -extern const pb_msgdesc_t substrait_SortField_msg; -extern const pb_msgdesc_t substrait_AggregateFunction_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define substrait_Expression_fields &substrait_Expression_msg -#define substrait_Expression_Enum_fields &substrait_Expression_Enum_msg -#define substrait_Expression_Enum_Empty_fields &substrait_Expression_Enum_Empty_msg -#define substrait_Expression_Literal_fields &substrait_Expression_Literal_msg -#define substrait_Expression_Literal_VarChar_fields &substrait_Expression_Literal_VarChar_msg -#define substrait_Expression_Literal_Decimal_fields &substrait_Expression_Literal_Decimal_msg -#define substrait_Expression_Literal_Map_fields &substrait_Expression_Literal_Map_msg -#define substrait_Expression_Literal_Map_KeyValue_fields &substrait_Expression_Literal_Map_KeyValue_msg -#define substrait_Expression_Literal_IntervalYearToMonth_fields &substrait_Expression_Literal_IntervalYearToMonth_msg -#define substrait_Expression_Literal_IntervalDayToSecond_fields &substrait_Expression_Literal_IntervalDayToSecond_msg -#define substrait_Expression_Literal_Struct_fields &substrait_Expression_Literal_Struct_msg -#define substrait_Expression_Literal_List_fields &substrait_Expression_Literal_List_msg -#define substrait_Expression_ScalarFunction_fields &substrait_Expression_ScalarFunction_msg -#define substrait_Expression_WindowFunction_fields &substrait_Expression_WindowFunction_msg -#define substrait_Expression_WindowFunction_Bound_fields &substrait_Expression_WindowFunction_Bound_msg -#define substrait_Expression_WindowFunction_Bound_Preceding_fields &substrait_Expression_WindowFunction_Bound_Preceding_msg -#define substrait_Expression_WindowFunction_Bound_Following_fields &substrait_Expression_WindowFunction_Bound_Following_msg -#define substrait_Expression_WindowFunction_Bound_CurrentRow_fields &substrait_Expression_WindowFunction_Bound_CurrentRow_msg -#define substrait_Expression_WindowFunction_Bound_Unbounded_fields &substrait_Expression_WindowFunction_Bound_Unbounded_msg -#define substrait_Expression_IfThen_fields &substrait_Expression_IfThen_msg -#define substrait_Expression_IfThen_IfClause_fields &substrait_Expression_IfThen_IfClause_msg -#define substrait_Expression_Cast_fields &substrait_Expression_Cast_msg -#define substrait_Expression_SwitchExpression_fields &substrait_Expression_SwitchExpression_msg -#define substrait_Expression_SwitchExpression_IfValue_fields &substrait_Expression_SwitchExpression_IfValue_msg -#define substrait_Expression_SingularOrList_fields &substrait_Expression_SingularOrList_msg -#define substrait_Expression_MultiOrList_fields &substrait_Expression_MultiOrList_msg -#define substrait_Expression_MultiOrList_Record_fields &substrait_Expression_MultiOrList_Record_msg -#define substrait_Expression_EmbeddedFunction_fields &substrait_Expression_EmbeddedFunction_msg -#define substrait_Expression_EmbeddedFunction_PythonPickleFunction_fields &substrait_Expression_EmbeddedFunction_PythonPickleFunction_msg -#define substrait_Expression_EmbeddedFunction_WebAssemblyFunction_fields &substrait_Expression_EmbeddedFunction_WebAssemblyFunction_msg -#define substrait_Expression_ReferenceSegment_fields &substrait_Expression_ReferenceSegment_msg -#define substrait_Expression_ReferenceSegment_MapKey_fields &substrait_Expression_ReferenceSegment_MapKey_msg -#define substrait_Expression_ReferenceSegment_StructField_fields &substrait_Expression_ReferenceSegment_StructField_msg -#define substrait_Expression_ReferenceSegment_ListElement_fields &substrait_Expression_ReferenceSegment_ListElement_msg -#define substrait_Expression_MaskExpression_fields &substrait_Expression_MaskExpression_msg -#define substrait_Expression_MaskExpression_Select_fields &substrait_Expression_MaskExpression_Select_msg -#define substrait_Expression_MaskExpression_StructSelect_fields &substrait_Expression_MaskExpression_StructSelect_msg -#define substrait_Expression_MaskExpression_StructItem_fields &substrait_Expression_MaskExpression_StructItem_msg -#define substrait_Expression_MaskExpression_ListSelect_fields &substrait_Expression_MaskExpression_ListSelect_msg -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_fields &substrait_Expression_MaskExpression_ListSelect_ListSelectItem_msg -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_fields &substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_msg -#define substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_fields &substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_msg -#define substrait_Expression_MaskExpression_MapSelect_fields &substrait_Expression_MaskExpression_MapSelect_msg -#define substrait_Expression_MaskExpression_MapSelect_MapKey_fields &substrait_Expression_MaskExpression_MapSelect_MapKey_msg -#define substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_fields &substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_msg -#define substrait_Expression_FieldReference_fields &substrait_Expression_FieldReference_msg -#define substrait_Expression_FieldReference_RootReference_fields &substrait_Expression_FieldReference_RootReference_msg -#define substrait_SortField_fields &substrait_SortField_msg -#define substrait_AggregateFunction_fields &substrait_AggregateFunction_msg - -/* Maximum encoded size of messages (where known) */ -/* substrait_Expression_size depends on runtime parameters */ -/* substrait_Expression_Enum_size depends on runtime parameters */ -/* substrait_Expression_Literal_size depends on runtime parameters */ -/* substrait_Expression_Literal_VarChar_size depends on runtime parameters */ -/* substrait_Expression_Literal_Decimal_size depends on runtime parameters */ -/* substrait_Expression_Literal_Map_size depends on runtime parameters */ -/* substrait_Expression_Literal_Map_KeyValue_size depends on runtime parameters */ -/* substrait_Expression_Literal_IntervalYearToMonth_size depends on runtime parameters */ -/* substrait_Expression_Literal_IntervalDayToSecond_size depends on runtime parameters */ -/* substrait_Expression_Literal_Struct_size depends on runtime parameters */ -/* substrait_Expression_Literal_List_size depends on runtime parameters */ -/* substrait_Expression_ScalarFunction_size depends on runtime parameters */ -/* substrait_Expression_WindowFunction_size depends on runtime parameters */ -/* substrait_Expression_WindowFunction_Bound_size depends on runtime parameters */ -/* substrait_Expression_WindowFunction_Bound_Preceding_size depends on runtime parameters */ -/* substrait_Expression_WindowFunction_Bound_Following_size depends on runtime parameters */ -/* substrait_Expression_IfThen_size depends on runtime parameters */ -/* substrait_Expression_IfThen_IfClause_size depends on runtime parameters */ -/* substrait_Expression_Cast_size depends on runtime parameters */ -/* substrait_Expression_SwitchExpression_size depends on runtime parameters */ -/* substrait_Expression_SwitchExpression_IfValue_size depends on runtime parameters */ -/* substrait_Expression_SingularOrList_size depends on runtime parameters */ -/* substrait_Expression_MultiOrList_size depends on runtime parameters */ -/* substrait_Expression_MultiOrList_Record_size depends on runtime parameters */ -/* substrait_Expression_EmbeddedFunction_size depends on runtime parameters */ -/* substrait_Expression_EmbeddedFunction_PythonPickleFunction_size depends on runtime parameters */ -/* substrait_Expression_EmbeddedFunction_WebAssemblyFunction_size depends on runtime parameters */ -/* substrait_Expression_ReferenceSegment_size depends on runtime parameters */ -/* substrait_Expression_ReferenceSegment_MapKey_size depends on runtime parameters */ -/* substrait_Expression_ReferenceSegment_StructField_size depends on runtime parameters */ -/* substrait_Expression_ReferenceSegment_ListElement_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_Select_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_StructSelect_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_StructItem_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_ListSelect_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_ListSelect_ListSelectItem_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListElement_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_ListSelect_ListSelectItem_ListSlice_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_MapSelect_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_MapSelect_MapKey_size depends on runtime parameters */ -/* substrait_Expression_MaskExpression_MapSelect_MapKeyExpression_size depends on runtime parameters */ -/* substrait_Expression_FieldReference_size depends on runtime parameters */ -/* substrait_SortField_size depends on runtime parameters */ -/* substrait_AggregateFunction_size depends on runtime parameters */ -#define substrait_Expression_Enum_Empty_size 0 -#define substrait_Expression_FieldReference_RootReference_size 0 -#define substrait_Expression_WindowFunction_Bound_CurrentRow_size 0 -#define substrait_Expression_WindowFunction_Bound_Unbounded_size 0 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/substrait/extensions/extensions.pb.h b/src/substrait/extensions/extensions.pb.h index 384a8b0e..624602e8 100644 --- a/src/substrait/extensions/extensions.pb.h +++ b/src/substrait/extensions/extensions.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_EXTENSIONS_SUBSTRAIT_EXTENSIONS_EXTENSIONS_PB_H_INCLUDED #define PB_SUBSTRAIT_EXTENSIONS_SUBSTRAIT_EXTENSIONS_EXTENSIONS_PB_H_INCLUDED @@ -12,8 +12,8 @@ /* Struct definitions */ typedef struct _substrait_extensions_AdvancedExtension { - struct _substrait_Any *optimization; - struct _substrait_Any *enhancement; + struct _substrait_Any *optimization; + struct _substrait_Any *enhancement; } substrait_extensions_AdvancedExtension; /* Describes a mapping between a specific extension entity and the uri where @@ -24,13 +24,13 @@ typedef struct _substrait_extensions_SimpleExtensionDeclaration { struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionType *extension_type; struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionTypeVariation *extension_type_variation; struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionFunction *extension_function; - } mapping_type; + } mapping_type; } substrait_extensions_SimpleExtensionDeclaration; typedef struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionFunction { - uint32_t *extension_uri_reference; - uint32_t *function_anchor; - char *name; + uint32_t *extension_uri_reference; + uint32_t *function_anchor; + char *name; } substrait_extensions_SimpleExtensionDeclaration_ExtensionFunction; /* A generic object that can be used to embed additional extension information @@ -38,25 +38,25 @@ typedef struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionFunctio typedef struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionType { /* An optimization is helpful information that don't influence semantics. May be ignored by a consumer. */ - uint32_t *extension_uri_reference; + uint32_t *extension_uri_reference; /* An enhancement alter semantics. Cannot be ignored by a consumer. */ - uint32_t *type_anchor; - char *name; + uint32_t *type_anchor; + char *name; } substrait_extensions_SimpleExtensionDeclaration_ExtensionType; typedef struct _substrait_extensions_SimpleExtensionDeclaration_ExtensionTypeVariation { - uint32_t *extension_uri_reference; - uint32_t *type_variation_anchor; - char *name; + uint32_t *extension_uri_reference; + uint32_t *type_variation_anchor; + char *name; } substrait_extensions_SimpleExtensionDeclaration_ExtensionTypeVariation; typedef struct _substrait_extensions_SimpleExtensionURI { /* A surrogate key used in the context of a single plan used to reference the URI associated with an extension. */ - uint32_t *extension_uri_anchor; + uint32_t *extension_uri_anchor; /* The URI where this extension YAML can be retrieved. This is the "namespace" of this extension. */ - char *uri; + char *uri; } substrait_extensions_SimpleExtensionURI; diff --git a/src/substrait/function.pb.h b/src/substrait/function.pb.h index 7bd08e30..b354b7a5 100644 --- a/src/substrait/function.pb.h +++ b/src/substrait/function.pb.h @@ -1,11 +1,11 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_FUNCTION_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_FUNCTION_PB_H_INCLUDED #include -#include "substrait/type.pb.h" #include "substrait/parameterized_types.pb.h" +#include "substrait/type.pb.h" #include "substrait/type_expressions.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -39,52 +39,52 @@ typedef struct _substrait_FunctionSignature { typedef struct _substrait_FunctionSignature_Aggregate { pb_size_t arguments_count; - struct _substrait_FunctionSignature_Argument *arguments; - char *name; - struct _substrait_FunctionSignature_Description *description; - bool *deterministic; - bool *session_dependent; - struct _substrait_DerivationExpression *output_type; + struct _substrait_FunctionSignature_Argument *arguments; + char *name; + struct _substrait_FunctionSignature_Description *description; + bool *deterministic; + bool *session_dependent; + struct _substrait_DerivationExpression *output_type; pb_size_t which_final_variable_behavior; union { struct _substrait_FunctionSignature_FinalArgVariadic *variadic; struct _substrait_FunctionSignature_FinalArgNormal *normal; - } final_variable_behavior; - uint64_t *max_set; - struct _substrait_Type *intermediate_type; - bool *ordered; + } final_variable_behavior; + uint64_t *max_set; + struct _substrait_Type *intermediate_type; + bool *ordered; pb_size_t implementations_count; - struct _substrait_FunctionSignature_Implementation *implementations; + struct _substrait_FunctionSignature_Implementation *implementations; } substrait_FunctionSignature_Aggregate; typedef struct _substrait_FunctionSignature_Argument { - char *name; + char *name; pb_size_t which_argument_kind; union { struct _substrait_FunctionSignature_Argument_ValueArgument *value; struct _substrait_FunctionSignature_Argument_TypeArgument *type; struct _substrait_FunctionSignature_Argument_EnumArgument *enum_; - } argument_kind; + } argument_kind; } substrait_FunctionSignature_Argument; typedef struct _substrait_FunctionSignature_Argument_EnumArgument { pb_size_t options_count; - char **options; - bool *optional; + char **options; + bool *optional; } substrait_FunctionSignature_Argument_EnumArgument; typedef struct _substrait_FunctionSignature_Argument_TypeArgument { - struct _substrait_ParameterizedType *type; + struct _substrait_ParameterizedType *type; } substrait_FunctionSignature_Argument_TypeArgument; typedef struct _substrait_FunctionSignature_Argument_ValueArgument { - struct _substrait_ParameterizedType *type; - bool *constant; + struct _substrait_ParameterizedType *type; + bool *constant; } substrait_FunctionSignature_Argument_ValueArgument; typedef struct _substrait_FunctionSignature_Description { - char *language; - char *body; + char *language; + char *body; } substrait_FunctionSignature_Description; typedef struct _substrait_FunctionSignature_FinalArgNormal { @@ -92,54 +92,54 @@ typedef struct _substrait_FunctionSignature_FinalArgNormal { } substrait_FunctionSignature_FinalArgNormal; typedef struct _substrait_FunctionSignature_FinalArgVariadic { - int64_t *min_args; - int64_t *max_args; - substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency *consistency; + int64_t *min_args; + int64_t *max_args; + substrait_FunctionSignature_FinalArgVariadic_ParameterConsistency *consistency; } substrait_FunctionSignature_FinalArgVariadic; typedef struct _substrait_FunctionSignature_Implementation { - substrait_FunctionSignature_Implementation_Type *type; - char *uri; + substrait_FunctionSignature_Implementation_Type *type; + char *uri; } substrait_FunctionSignature_Implementation; typedef struct _substrait_FunctionSignature_Scalar { pb_size_t arguments_count; - struct _substrait_FunctionSignature_Argument *arguments; + struct _substrait_FunctionSignature_Argument *arguments; pb_size_t name_count; - char **name; - struct _substrait_FunctionSignature_Description *description; - bool *deterministic; - bool *session_dependent; - struct _substrait_DerivationExpression *output_type; + char **name; + struct _substrait_FunctionSignature_Description *description; + bool *deterministic; + bool *session_dependent; + struct _substrait_DerivationExpression *output_type; pb_size_t which_final_variable_behavior; union { struct _substrait_FunctionSignature_FinalArgVariadic *variadic; struct _substrait_FunctionSignature_FinalArgNormal *normal; - } final_variable_behavior; + } final_variable_behavior; pb_size_t implementations_count; - struct _substrait_FunctionSignature_Implementation *implementations; + struct _substrait_FunctionSignature_Implementation *implementations; } substrait_FunctionSignature_Scalar; typedef struct _substrait_FunctionSignature_Window { pb_size_t arguments_count; - struct _substrait_FunctionSignature_Argument *arguments; + struct _substrait_FunctionSignature_Argument *arguments; pb_size_t name_count; - char **name; - struct _substrait_FunctionSignature_Description *description; - bool *deterministic; - bool *session_dependent; - struct _substrait_DerivationExpression *intermediate_type; - struct _substrait_DerivationExpression *output_type; - bool *ordered; - uint64_t *max_set; - substrait_FunctionSignature_Window_WindowType *window_type; + char **name; + struct _substrait_FunctionSignature_Description *description; + bool *deterministic; + bool *session_dependent; + struct _substrait_DerivationExpression *intermediate_type; + struct _substrait_DerivationExpression *output_type; + bool *ordered; + uint64_t *max_set; + substrait_FunctionSignature_Window_WindowType *window_type; pb_size_t implementations_count; - struct _substrait_FunctionSignature_Implementation *implementations; + struct _substrait_FunctionSignature_Implementation *implementations; pb_size_t which_final_variable_behavior; union { struct _substrait_FunctionSignature_FinalArgVariadic *variadic; struct _substrait_FunctionSignature_FinalArgNormal *normal; - } final_variable_behavior; + } final_variable_behavior; } substrait_FunctionSignature_Window; diff --git a/src/substrait/parameterized_types.pb.h b/src/substrait/parameterized_types.pb.h index ef82882b..180de27b 100644 --- a/src/substrait/parameterized_types.pb.h +++ b/src/substrait/parameterized_types.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_PARAMETERIZED_TYPES_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_PARAMETERIZED_TYPES_PB_H_INCLUDED @@ -36,10 +36,14 @@ typedef struct _substrait_ParameterizedType { struct _substrait_ParameterizedType_ParameterizedList *list; struct _substrait_ParameterizedType_ParameterizedMap *map; struct _substrait_Type_TimestampTZ *timestamp_tz; + struct _substrait_ParameterizedType_ParameterizedUserDefined *user_defined; + /* Deprecated in favor of user_defined, which allows nullability and + variations to be specified. If user_defined_pointer is encountered, + treat it as being non-nullable and having the default variation. */ uint32_t *user_defined_pointer; struct _substrait_Type_UUID *uuid; struct _substrait_ParameterizedType_TypeParameter *type_parameter; - } kind; + } kind; } substrait_ParameterizedType; typedef struct _substrait_ParameterizedType_IntegerOption { @@ -47,74 +51,80 @@ typedef struct _substrait_ParameterizedType_IntegerOption { union { int32_t *literal; struct _substrait_ParameterizedType_IntegerParameter *parameter; - } integer_type; + } integer_type; } substrait_ParameterizedType_IntegerOption; typedef struct _substrait_ParameterizedType_IntegerParameter { - char *name; - struct _substrait_ParameterizedType_NullableInteger *range_start_inclusive; - struct _substrait_ParameterizedType_NullableInteger *range_end_exclusive; + char *name; + struct _substrait_ParameterizedType_NullableInteger *range_start_inclusive; + struct _substrait_ParameterizedType_NullableInteger *range_end_exclusive; } substrait_ParameterizedType_IntegerParameter; typedef struct _substrait_ParameterizedType_NullableInteger { - int64_t *value; + int64_t *value; } substrait_ParameterizedType_NullableInteger; typedef struct _substrait_ParameterizedType_ParameterizedDecimal { - struct _substrait_ParameterizedType_IntegerOption *scale; - struct _substrait_ParameterizedType_IntegerOption *precision; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType_IntegerOption *scale; + struct _substrait_ParameterizedType_IntegerOption *precision; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedDecimal; typedef struct _substrait_ParameterizedType_ParameterizedFixedBinary { - struct _substrait_ParameterizedType_IntegerOption *length; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType_IntegerOption *length; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedFixedBinary; typedef struct _substrait_ParameterizedType_ParameterizedFixedChar { - struct _substrait_ParameterizedType_IntegerOption *length; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType_IntegerOption *length; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedFixedChar; typedef struct _substrait_ParameterizedType_ParameterizedList { - struct _substrait_ParameterizedType *type; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType *type; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedList; typedef struct _substrait_ParameterizedType_ParameterizedMap { - struct _substrait_ParameterizedType *key; - struct _substrait_ParameterizedType *value; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType *key; + struct _substrait_ParameterizedType *value; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedMap; typedef struct _substrait_ParameterizedType_ParameterizedNamedStruct { pb_size_t names_count; - char **names; - struct _substrait_ParameterizedType_ParameterizedStruct *struct_; + char **names; + struct _substrait_ParameterizedType_ParameterizedStruct *struct_; } substrait_ParameterizedType_ParameterizedNamedStruct; typedef struct _substrait_ParameterizedType_ParameterizedStruct { pb_size_t types_count; - struct _substrait_ParameterizedType *types; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType *types; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedStruct; +typedef struct _substrait_ParameterizedType_ParameterizedUserDefined { + uint32_t *type_pointer; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; +} substrait_ParameterizedType_ParameterizedUserDefined; + typedef struct _substrait_ParameterizedType_ParameterizedVarChar { - struct _substrait_ParameterizedType_IntegerOption *length; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_ParameterizedType_IntegerOption *length; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_ParameterizedType_ParameterizedVarChar; typedef struct _substrait_ParameterizedType_TypeParameter { - char *name; + char *name; pb_size_t bounds_count; - struct _substrait_ParameterizedType *bounds; + struct _substrait_ParameterizedType *bounds; } substrait_ParameterizedType_TypeParameter; @@ -135,6 +145,7 @@ extern "C" { #define substrait_ParameterizedType_ParameterizedNamedStruct_init_default {0, NULL, NULL} #define substrait_ParameterizedType_ParameterizedList_init_default {NULL, NULL, NULL} #define substrait_ParameterizedType_ParameterizedMap_init_default {NULL, NULL, NULL, NULL} +#define substrait_ParameterizedType_ParameterizedUserDefined_init_default {NULL, NULL, NULL} #define substrait_ParameterizedType_IntegerOption_init_default {0, {NULL}} #define substrait_ParameterizedType_init_zero {0, {NULL}} #define substrait_ParameterizedType_TypeParameter_init_zero {NULL, 0, NULL} @@ -148,6 +159,7 @@ extern "C" { #define substrait_ParameterizedType_ParameterizedNamedStruct_init_zero {0, NULL, NULL} #define substrait_ParameterizedType_ParameterizedList_init_zero {NULL, NULL, NULL} #define substrait_ParameterizedType_ParameterizedMap_init_zero {NULL, NULL, NULL, NULL} +#define substrait_ParameterizedType_ParameterizedUserDefined_init_zero {NULL, NULL, NULL} #define substrait_ParameterizedType_IntegerOption_init_zero {0, {NULL}} /* Field tags (for use in manual encoding/decoding) */ @@ -173,6 +185,7 @@ extern "C" { #define substrait_ParameterizedType_list_tag 27 #define substrait_ParameterizedType_map_tag 28 #define substrait_ParameterizedType_timestamp_tz_tag 29 +#define substrait_ParameterizedType_user_defined_tag 30 #define substrait_ParameterizedType_user_defined_pointer_tag 31 #define substrait_ParameterizedType_uuid_tag 32 #define substrait_ParameterizedType_type_parameter_tag 33 @@ -204,6 +217,9 @@ extern "C" { #define substrait_ParameterizedType_ParameterizedStruct_types_tag 1 #define substrait_ParameterizedType_ParameterizedStruct_variation_pointer_tag 2 #define substrait_ParameterizedType_ParameterizedStruct_nullability_tag 3 +#define substrait_ParameterizedType_ParameterizedUserDefined_type_pointer_tag 1 +#define substrait_ParameterizedType_ParameterizedUserDefined_variation_pointer_tag 2 +#define substrait_ParameterizedType_ParameterizedUserDefined_nullability_tag 3 #define substrait_ParameterizedType_ParameterizedVarChar_length_tag 1 #define substrait_ParameterizedType_ParameterizedVarChar_variation_pointer_tag 2 #define substrait_ParameterizedType_ParameterizedVarChar_nullability_tag 3 @@ -234,6 +250,7 @@ X(a, POINTER, ONEOF, MESSAGE, (kind,struct_,kind.struct_), 25) \ X(a, POINTER, ONEOF, MESSAGE, (kind,list,kind.list), 27) \ X(a, POINTER, ONEOF, MESSAGE, (kind,map,kind.map), 28) \ X(a, POINTER, ONEOF, MESSAGE, (kind,timestamp_tz,kind.timestamp_tz), 29) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,user_defined,kind.user_defined), 30) \ X(a, POINTER, ONEOF, UINT32, (kind,user_defined_pointer,kind.user_defined_pointer), 31) \ X(a, POINTER, ONEOF, MESSAGE, (kind,uuid,kind.uuid), 32) \ X(a, POINTER, ONEOF, MESSAGE, (kind,type_parameter,kind.type_parameter), 33) @@ -261,6 +278,7 @@ X(a, POINTER, ONEOF, MESSAGE, (kind,type_parameter,kind.type_parameter), 3 #define substrait_ParameterizedType_kind_list_MSGTYPE substrait_ParameterizedType_ParameterizedList #define substrait_ParameterizedType_kind_map_MSGTYPE substrait_ParameterizedType_ParameterizedMap #define substrait_ParameterizedType_kind_timestamp_tz_MSGTYPE substrait_Type_TimestampTZ +#define substrait_ParameterizedType_kind_user_defined_MSGTYPE substrait_ParameterizedType_ParameterizedUserDefined #define substrait_ParameterizedType_kind_uuid_MSGTYPE substrait_Type_UUID #define substrait_ParameterizedType_kind_type_parameter_MSGTYPE substrait_ParameterizedType_TypeParameter @@ -352,6 +370,13 @@ X(a, POINTER, SINGULAR, UENUM, nullability, 4) #define substrait_ParameterizedType_ParameterizedMap_key_MSGTYPE substrait_ParameterizedType #define substrait_ParameterizedType_ParameterizedMap_value_MSGTYPE substrait_ParameterizedType +#define substrait_ParameterizedType_ParameterizedUserDefined_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, type_pointer, 1) \ +X(a, POINTER, SINGULAR, UINT32, variation_pointer, 2) \ +X(a, POINTER, SINGULAR, UENUM, nullability, 3) +#define substrait_ParameterizedType_ParameterizedUserDefined_CALLBACK NULL +#define substrait_ParameterizedType_ParameterizedUserDefined_DEFAULT NULL + #define substrait_ParameterizedType_IntegerOption_FIELDLIST(X, a) \ X(a, POINTER, ONEOF, INT32, (integer_type,literal,integer_type.literal), 1) \ X(a, POINTER, ONEOF, MESSAGE, (integer_type,parameter,integer_type.parameter), 2) @@ -371,6 +396,7 @@ extern const pb_msgdesc_t substrait_ParameterizedType_ParameterizedStruct_msg; extern const pb_msgdesc_t substrait_ParameterizedType_ParameterizedNamedStruct_msg; extern const pb_msgdesc_t substrait_ParameterizedType_ParameterizedList_msg; extern const pb_msgdesc_t substrait_ParameterizedType_ParameterizedMap_msg; +extern const pb_msgdesc_t substrait_ParameterizedType_ParameterizedUserDefined_msg; extern const pb_msgdesc_t substrait_ParameterizedType_IntegerOption_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ @@ -386,6 +412,7 @@ extern const pb_msgdesc_t substrait_ParameterizedType_IntegerOption_msg; #define substrait_ParameterizedType_ParameterizedNamedStruct_fields &substrait_ParameterizedType_ParameterizedNamedStruct_msg #define substrait_ParameterizedType_ParameterizedList_fields &substrait_ParameterizedType_ParameterizedList_msg #define substrait_ParameterizedType_ParameterizedMap_fields &substrait_ParameterizedType_ParameterizedMap_msg +#define substrait_ParameterizedType_ParameterizedUserDefined_fields &substrait_ParameterizedType_ParameterizedUserDefined_msg #define substrait_ParameterizedType_IntegerOption_fields &substrait_ParameterizedType_IntegerOption_msg /* Maximum encoded size of messages (where known) */ @@ -401,6 +428,7 @@ extern const pb_msgdesc_t substrait_ParameterizedType_IntegerOption_msg; /* substrait_ParameterizedType_ParameterizedNamedStruct_size depends on runtime parameters */ /* substrait_ParameterizedType_ParameterizedList_size depends on runtime parameters */ /* substrait_ParameterizedType_ParameterizedMap_size depends on runtime parameters */ +/* substrait_ParameterizedType_ParameterizedUserDefined_size depends on runtime parameters */ /* substrait_ParameterizedType_IntegerOption_size depends on runtime parameters */ #ifdef __cplusplus diff --git a/src/substrait/plan.pb.h b/src/substrait/plan.pb.h index 966ad7f4..58095ffd 100644 --- a/src/substrait/plan.pb.h +++ b/src/substrait/plan.pb.h @@ -1,10 +1,10 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_PLAN_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_PLAN_PB_H_INCLUDED #include -#include "substrait/relations.pb.h" +#include "substrait/algebra.pb.h" #include "substrait/extensions/extensions.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -17,32 +17,33 @@ typedef struct _substrait_Plan { /* a list of yaml specifications this plan may depend on */ pb_size_t extension_uris_count; - struct _substrait_extensions_SimpleExtensionURI *extension_uris; + struct _substrait_extensions_SimpleExtensionURI *extension_uris; /* a list of extensions this plan may depend on */ pb_size_t extensions_count; - struct _substrait_extensions_SimpleExtensionDeclaration *extensions; + struct _substrait_extensions_SimpleExtensionDeclaration *extensions; /* one or more relation trees that are associated with this plan. */ pb_size_t relations_count; - struct _substrait_PlanRel *relations; + struct _substrait_PlanRel *relations; /* additional extensions associated with this plan. */ - struct _substrait_extensions_AdvancedExtension *advanced_extensions; + struct _substrait_extensions_AdvancedExtension *advanced_extensions; /* A list of com.google.Any entities that this plan may use. Can be used to warn if some embedded message types are unknown. Note that this list may include message types that are ignorable (optimizations) or that are unused. In many cases, a consumer may be able to work with a plan even if one or more message types defined here are unknown. */ pb_size_t expected_type_urls_count; - char **expected_type_urls; + char **expected_type_urls; } substrait_Plan; /* Either a relation or root relation */ typedef struct _substrait_PlanRel { - /* Any relation */ pb_size_t which_rel_type; union { + /* Any relation (used for references and CTEs) */ struct _substrait_Rel *rel; + /* The root of a relation tree */ struct _substrait_RelRoot *root; - } rel_type; + } rel_type; } substrait_PlanRel; diff --git a/src/substrait/relations.pb.h b/src/substrait/relations.pb.h deleted file mode 100644 index 3aee9f5a..00000000 --- a/src/substrait/relations.pb.h +++ /dev/null @@ -1,773 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ - -#ifndef PB_SUBSTRAIT_SUBSTRAIT_RELATIONS_PB_H_INCLUDED -#define PB_SUBSTRAIT_SUBSTRAIT_RELATIONS_PB_H_INCLUDED -#include -#include "substrait/any.pb.h" -#include "substrait/type.pb.h" -#include "substrait/expression.pb.h" -#include "substrait/extensions/extensions.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -typedef enum _substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat { - substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_FILE_FORMAT_UNSPECIFIED = 0, - substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_FILE_FORMAT_PARQUET = 1 -} substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat; - -typedef enum _substrait_JoinRel_JoinType { - substrait_JoinRel_JoinType_JOIN_TYPE_UNSPECIFIED = 0, - substrait_JoinRel_JoinType_JOIN_TYPE_INNER = 1, - substrait_JoinRel_JoinType_JOIN_TYPE_OUTER = 2, - substrait_JoinRel_JoinType_JOIN_TYPE_LEFT = 3, - substrait_JoinRel_JoinType_JOIN_TYPE_RIGHT = 4, - substrait_JoinRel_JoinType_JOIN_TYPE_SEMI = 5, - substrait_JoinRel_JoinType_JOIN_TYPE_ANTI = 6 -} substrait_JoinRel_JoinType; - -typedef enum _substrait_SetRel_SetOp { - substrait_SetRel_SetOp_SET_OP_UNSPECIFIED = 0, - substrait_SetRel_SetOp_SET_OP_MINUS_PRIMARY = 1, - substrait_SetRel_SetOp_SET_OP_MINUS_MULTISET = 2, - substrait_SetRel_SetOp_SET_OP_INTERSECTION_PRIMARY = 3, - substrait_SetRel_SetOp_SET_OP_INTERSECTION_MULTISET = 4, - substrait_SetRel_SetOp_SET_OP_UNION_DISTINCT = 5, - substrait_SetRel_SetOp_SET_OP_UNION_ALL = 6 -} substrait_SetRel_SetOp; - -/* Struct definitions */ -typedef struct _substrait_AggregateRel { - struct _substrait_RelCommon *common; - struct _substrait_Rel *input; - pb_size_t groupings_count; - struct _substrait_AggregateRel_Grouping *groupings; - pb_size_t measures_count; - struct _substrait_AggregateRel_Measure *measures; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_AggregateRel; - -typedef struct _substrait_AggregateRel_Grouping { - pb_size_t grouping_expressions_count; - struct _substrait_Expression *grouping_expressions; -} substrait_AggregateRel_Grouping; - -typedef struct _substrait_AggregateRel_Measure { - struct _substrait_AggregateFunction *measure; - struct _substrait_Expression *filter; -} substrait_AggregateRel_Measure; - -typedef struct _substrait_ExtensionLeafRel { - struct _substrait_RelCommon *common; - struct _substrait_Any *detail; -} substrait_ExtensionLeafRel; - -typedef struct _substrait_ExtensionMultiRel { - struct _substrait_RelCommon *common; - pb_size_t inputs_count; - struct _substrait_Rel *inputs; - struct _substrait_Any *detail; -} substrait_ExtensionMultiRel; - -typedef struct _substrait_ExtensionSingleRel { - struct _substrait_RelCommon *common; - struct _substrait_Rel *input; - struct _substrait_Any *detail; -} substrait_ExtensionSingleRel; - -typedef struct _substrait_FetchRel { - struct _substrait_RelCommon *common; - struct _substrait_Rel *input; - int64_t *offset; - int64_t *count; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_FetchRel; - -typedef struct _substrait_FilterRel { - struct _substrait_RelCommon *common; - struct _substrait_Rel *input; - struct _substrait_Expression *condition; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_FilterRel; - -typedef struct _substrait_JoinRel { - struct _substrait_RelCommon *common; - struct _substrait_Rel *left; - struct _substrait_Rel *right; - struct _substrait_Expression *expression; - struct _substrait_Expression *post_join_filter; - substrait_JoinRel_JoinType *type; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_JoinRel; - -/* A relation with output field names. - - This is for use at the root of a `Rel` tree. */ -typedef struct _substrait_ProjectRel { - /* A relation */ - struct _substrait_RelCommon *common; - /* Field names in depth-first order */ - struct _substrait_Rel *input; - pb_size_t expressions_count; - struct _substrait_Expression *expressions; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_ProjectRel; - -typedef struct _substrait_ReadRel { - struct _substrait_RelCommon *common; - struct _substrait_NamedStruct *base_schema; - struct _substrait_Expression *filter; - struct _substrait_Expression_MaskExpression *projection; - pb_size_t which_read_type; - union { - struct _substrait_ReadRel_VirtualTable *virtual_table; - struct _substrait_ReadRel_LocalFiles *local_files; - struct _substrait_ReadRel_NamedTable *named_table; - struct _substrait_ReadRel_ExtensionTable *extension_table; - } read_type; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_ReadRel; - -/* Stub to support extension with a single input */ -typedef struct _substrait_ReadRel_ExtensionTable { - struct _substrait_Any *detail; -} substrait_ReadRel_ExtensionTable; - -/* Stub to support extension with a zero inputs */ -typedef struct _substrait_ReadRel_LocalFiles { - pb_size_t items_count; - struct _substrait_ReadRel_LocalFiles_FileOrFiles *items; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_ReadRel_LocalFiles; - -/* Stub to support extension with multiple inputs */ -typedef struct _substrait_ReadRel_LocalFiles_FileOrFiles { - pb_size_t which_path_type; - union { - char *uri_path; - char *uri_path_glob; - char *uri_file; - char *uri_folder; - } path_type; - substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat *format; - uint64_t *partition_index; - uint64_t *start; - uint64_t *length; -} substrait_ReadRel_LocalFiles_FileOrFiles; - -typedef struct _substrait_ReadRel_NamedTable { - pb_size_t names_count; - char **names; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_ReadRel_NamedTable; - -typedef struct _substrait_ReadRel_VirtualTable { - pb_size_t values_count; - struct _substrait_Expression_Literal_Struct *values; -} substrait_ReadRel_VirtualTable; - -typedef struct _substrait_Rel { - pb_size_t which_rel_type; - union { - struct _substrait_ReadRel *read; - struct _substrait_FilterRel *filter; - struct _substrait_FetchRel *fetch; - struct _substrait_AggregateRel *aggregate; - struct _substrait_SortRel *sort; - struct _substrait_JoinRel *join; - struct _substrait_ProjectRel *project; - struct _substrait_SetRel *set; - struct _substrait_ExtensionSingleRel *extension_single; - struct _substrait_ExtensionMultiRel *extension_multi; - struct _substrait_ExtensionLeafRel *extension_leaf; - } rel_type; -} substrait_Rel; - -typedef struct _substrait_RelCommon { - pb_size_t which_emit_kind; - union { - struct _substrait_RelCommon_Direct *direct; - struct _substrait_RelCommon_Emit *emit; - } emit_kind; - struct _substrait_RelCommon_Hint *hint; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_RelCommon; - -typedef struct _substrait_RelCommon_Direct { - char dummy_field; -} substrait_RelCommon_Direct; - -typedef struct _substrait_RelCommon_Emit { - pb_size_t output_mapping_count; - int32_t *output_mapping; -} substrait_RelCommon_Emit; - -typedef struct _substrait_RelCommon_Hint { - struct _substrait_RelCommon_Hint_Stats *stats; - struct _substrait_RelCommon_Hint_RuntimeConstraint *constraint; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_RelCommon_Hint; - -typedef struct _substrait_RelCommon_Hint_RuntimeConstraint { - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_RelCommon_Hint_RuntimeConstraint; - -typedef struct _substrait_RelCommon_Hint_Stats { - double *row_count; - double *record_size; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_RelCommon_Hint_Stats; - -typedef struct _substrait_RelRoot { - struct _substrait_Rel *input; - pb_size_t names_count; - char **names; -} substrait_RelRoot; - -typedef struct _substrait_SetRel { - struct _substrait_RelCommon *common; - pb_size_t inputs_count; - struct _substrait_Rel *inputs; - substrait_SetRel_SetOp *op; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_SetRel; - -typedef struct _substrait_SortRel { - struct _substrait_RelCommon *common; - struct _substrait_Rel *input; - pb_size_t sorts_count; - struct _substrait_SortField *sorts; - struct _substrait_extensions_AdvancedExtension *advanced_extension; -} substrait_SortRel; - - -/* Helper constants for enums */ -#define _substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_MIN substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_FILE_FORMAT_UNSPECIFIED -#define _substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_MAX substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_FILE_FORMAT_PARQUET -#define _substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_ARRAYSIZE ((substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat)(substrait_ReadRel_LocalFiles_FileOrFiles_FileFormat_FILE_FORMAT_PARQUET+1)) - -#define _substrait_JoinRel_JoinType_MIN substrait_JoinRel_JoinType_JOIN_TYPE_UNSPECIFIED -#define _substrait_JoinRel_JoinType_MAX substrait_JoinRel_JoinType_JOIN_TYPE_ANTI -#define _substrait_JoinRel_JoinType_ARRAYSIZE ((substrait_JoinRel_JoinType)(substrait_JoinRel_JoinType_JOIN_TYPE_ANTI+1)) - -#define _substrait_SetRel_SetOp_MIN substrait_SetRel_SetOp_SET_OP_UNSPECIFIED -#define _substrait_SetRel_SetOp_MAX substrait_SetRel_SetOp_SET_OP_UNION_ALL -#define _substrait_SetRel_SetOp_ARRAYSIZE ((substrait_SetRel_SetOp)(substrait_SetRel_SetOp_SET_OP_UNION_ALL+1)) - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define substrait_RelCommon_init_default {0, {NULL}, NULL, NULL} -#define substrait_RelCommon_Direct_init_default {0} -#define substrait_RelCommon_Emit_init_default {0, NULL} -#define substrait_RelCommon_Hint_init_default {NULL, NULL, NULL} -#define substrait_RelCommon_Hint_Stats_init_default {NULL, NULL, NULL} -#define substrait_RelCommon_Hint_RuntimeConstraint_init_default {NULL} -#define substrait_ReadRel_init_default {NULL, NULL, NULL, NULL, 0, {NULL}, NULL} -#define substrait_ReadRel_NamedTable_init_default {0, NULL, NULL} -#define substrait_ReadRel_VirtualTable_init_default {0, NULL} -#define substrait_ReadRel_ExtensionTable_init_default {NULL} -#define substrait_ReadRel_LocalFiles_init_default {0, NULL, NULL} -#define substrait_ReadRel_LocalFiles_FileOrFiles_init_default {0, {NULL}, NULL, NULL, NULL, NULL} -#define substrait_ProjectRel_init_default {NULL, NULL, 0, NULL, NULL} -#define substrait_JoinRel_init_default {NULL, NULL, NULL, NULL, NULL, NULL, NULL} -#define substrait_FetchRel_init_default {NULL, NULL, NULL, NULL, NULL} -#define substrait_AggregateRel_init_default {NULL, NULL, 0, NULL, 0, NULL, NULL} -#define substrait_AggregateRel_Grouping_init_default {0, NULL} -#define substrait_AggregateRel_Measure_init_default {NULL, NULL} -#define substrait_SortRel_init_default {NULL, NULL, 0, NULL, NULL} -#define substrait_FilterRel_init_default {NULL, NULL, NULL, NULL} -#define substrait_SetRel_init_default {NULL, 0, NULL, NULL, NULL} -#define substrait_ExtensionSingleRel_init_default {NULL, NULL, NULL} -#define substrait_ExtensionLeafRel_init_default {NULL, NULL} -#define substrait_ExtensionMultiRel_init_default {NULL, 0, NULL, NULL} -#define substrait_RelRoot_init_default {NULL, 0, NULL} -#define substrait_Rel_init_default {0, {NULL}} -#define substrait_RelCommon_init_zero {0, {NULL}, NULL, NULL} -#define substrait_RelCommon_Direct_init_zero {0} -#define substrait_RelCommon_Emit_init_zero {0, NULL} -#define substrait_RelCommon_Hint_init_zero {NULL, NULL, NULL} -#define substrait_RelCommon_Hint_Stats_init_zero {NULL, NULL, NULL} -#define substrait_RelCommon_Hint_RuntimeConstraint_init_zero {NULL} -#define substrait_ReadRel_init_zero {NULL, NULL, NULL, NULL, 0, {NULL}, NULL} -#define substrait_ReadRel_NamedTable_init_zero {0, NULL, NULL} -#define substrait_ReadRel_VirtualTable_init_zero {0, NULL} -#define substrait_ReadRel_ExtensionTable_init_zero {NULL} -#define substrait_ReadRel_LocalFiles_init_zero {0, NULL, NULL} -#define substrait_ReadRel_LocalFiles_FileOrFiles_init_zero {0, {NULL}, NULL, NULL, NULL, NULL} -#define substrait_ProjectRel_init_zero {NULL, NULL, 0, NULL, NULL} -#define substrait_JoinRel_init_zero {NULL, NULL, NULL, NULL, NULL, NULL, NULL} -#define substrait_FetchRel_init_zero {NULL, NULL, NULL, NULL, NULL} -#define substrait_AggregateRel_init_zero {NULL, NULL, 0, NULL, 0, NULL, NULL} -#define substrait_AggregateRel_Grouping_init_zero {0, NULL} -#define substrait_AggregateRel_Measure_init_zero {NULL, NULL} -#define substrait_SortRel_init_zero {NULL, NULL, 0, NULL, NULL} -#define substrait_FilterRel_init_zero {NULL, NULL, NULL, NULL} -#define substrait_SetRel_init_zero {NULL, 0, NULL, NULL, NULL} -#define substrait_ExtensionSingleRel_init_zero {NULL, NULL, NULL} -#define substrait_ExtensionLeafRel_init_zero {NULL, NULL} -#define substrait_ExtensionMultiRel_init_zero {NULL, 0, NULL, NULL} -#define substrait_RelRoot_init_zero {NULL, 0, NULL} -#define substrait_Rel_init_zero {0, {NULL}} - -/* Field tags (for use in manual encoding/decoding) */ -#define substrait_AggregateRel_common_tag 1 -#define substrait_AggregateRel_input_tag 2 -#define substrait_AggregateRel_groupings_tag 3 -#define substrait_AggregateRel_measures_tag 4 -#define substrait_AggregateRel_advanced_extension_tag 10 -#define substrait_AggregateRel_Grouping_grouping_expressions_tag 1 -#define substrait_AggregateRel_Measure_measure_tag 1 -#define substrait_AggregateRel_Measure_filter_tag 2 -#define substrait_ExtensionLeafRel_common_tag 1 -#define substrait_ExtensionLeafRel_detail_tag 2 -#define substrait_ExtensionMultiRel_common_tag 1 -#define substrait_ExtensionMultiRel_inputs_tag 2 -#define substrait_ExtensionMultiRel_detail_tag 3 -#define substrait_ExtensionSingleRel_common_tag 1 -#define substrait_ExtensionSingleRel_input_tag 2 -#define substrait_ExtensionSingleRel_detail_tag 3 -#define substrait_FetchRel_common_tag 1 -#define substrait_FetchRel_input_tag 2 -#define substrait_FetchRel_offset_tag 3 -#define substrait_FetchRel_count_tag 4 -#define substrait_FetchRel_advanced_extension_tag 10 -#define substrait_FilterRel_common_tag 1 -#define substrait_FilterRel_input_tag 2 -#define substrait_FilterRel_condition_tag 3 -#define substrait_FilterRel_advanced_extension_tag 10 -#define substrait_JoinRel_common_tag 1 -#define substrait_JoinRel_left_tag 2 -#define substrait_JoinRel_right_tag 3 -#define substrait_JoinRel_expression_tag 4 -#define substrait_JoinRel_post_join_filter_tag 5 -#define substrait_JoinRel_type_tag 6 -#define substrait_JoinRel_advanced_extension_tag 10 -#define substrait_ProjectRel_common_tag 1 -#define substrait_ProjectRel_input_tag 2 -#define substrait_ProjectRel_expressions_tag 3 -#define substrait_ProjectRel_advanced_extension_tag 10 -#define substrait_ReadRel_common_tag 1 -#define substrait_ReadRel_base_schema_tag 2 -#define substrait_ReadRel_filter_tag 3 -#define substrait_ReadRel_projection_tag 4 -#define substrait_ReadRel_virtual_table_tag 5 -#define substrait_ReadRel_local_files_tag 6 -#define substrait_ReadRel_named_table_tag 7 -#define substrait_ReadRel_extension_table_tag 8 -#define substrait_ReadRel_advanced_extension_tag 10 -#define substrait_ReadRel_ExtensionTable_detail_tag 1 -#define substrait_ReadRel_LocalFiles_items_tag 1 -#define substrait_ReadRel_LocalFiles_advanced_extension_tag 10 -#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_path_tag 1 -#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_path_glob_tag 2 -#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_file_tag 3 -#define substrait_ReadRel_LocalFiles_FileOrFiles_uri_folder_tag 4 -#define substrait_ReadRel_LocalFiles_FileOrFiles_format_tag 5 -#define substrait_ReadRel_LocalFiles_FileOrFiles_partition_index_tag 6 -#define substrait_ReadRel_LocalFiles_FileOrFiles_start_tag 7 -#define substrait_ReadRel_LocalFiles_FileOrFiles_length_tag 8 -#define substrait_ReadRel_NamedTable_names_tag 1 -#define substrait_ReadRel_NamedTable_advanced_extension_tag 10 -#define substrait_ReadRel_VirtualTable_values_tag 1 -#define substrait_Rel_read_tag 1 -#define substrait_Rel_filter_tag 2 -#define substrait_Rel_fetch_tag 3 -#define substrait_Rel_aggregate_tag 4 -#define substrait_Rel_sort_tag 5 -#define substrait_Rel_join_tag 6 -#define substrait_Rel_project_tag 7 -#define substrait_Rel_set_tag 8 -#define substrait_Rel_extension_single_tag 9 -#define substrait_Rel_extension_multi_tag 10 -#define substrait_Rel_extension_leaf_tag 11 -#define substrait_RelCommon_direct_tag 1 -#define substrait_RelCommon_emit_tag 2 -#define substrait_RelCommon_hint_tag 3 -#define substrait_RelCommon_advanced_extension_tag 4 -#define substrait_RelCommon_Emit_output_mapping_tag 1 -#define substrait_RelCommon_Hint_stats_tag 1 -#define substrait_RelCommon_Hint_constraint_tag 2 -#define substrait_RelCommon_Hint_advanced_extension_tag 10 -#define substrait_RelCommon_Hint_RuntimeConstraint_advanced_extension_tag 10 -#define substrait_RelCommon_Hint_Stats_row_count_tag 1 -#define substrait_RelCommon_Hint_Stats_record_size_tag 2 -#define substrait_RelCommon_Hint_Stats_advanced_extension_tag 10 -#define substrait_RelRoot_input_tag 1 -#define substrait_RelRoot_names_tag 2 -#define substrait_SetRel_common_tag 1 -#define substrait_SetRel_inputs_tag 2 -#define substrait_SetRel_op_tag 3 -#define substrait_SetRel_advanced_extension_tag 10 -#define substrait_SortRel_common_tag 1 -#define substrait_SortRel_input_tag 2 -#define substrait_SortRel_sorts_tag 3 -#define substrait_SortRel_advanced_extension_tag 10 - -/* Struct field encoding specification for nanopb */ -#define substrait_RelCommon_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (emit_kind,direct,emit_kind.direct), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (emit_kind,emit,emit_kind.emit), 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, hint, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 4) -#define substrait_RelCommon_CALLBACK NULL -#define substrait_RelCommon_DEFAULT NULL -#define substrait_RelCommon_emit_kind_direct_MSGTYPE substrait_RelCommon_Direct -#define substrait_RelCommon_emit_kind_emit_MSGTYPE substrait_RelCommon_Emit -#define substrait_RelCommon_hint_MSGTYPE substrait_RelCommon_Hint -#define substrait_RelCommon_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_RelCommon_Direct_FIELDLIST(X, a) \ - -#define substrait_RelCommon_Direct_CALLBACK NULL -#define substrait_RelCommon_Direct_DEFAULT NULL - -#define substrait_RelCommon_Emit_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, INT32, output_mapping, 1) -#define substrait_RelCommon_Emit_CALLBACK NULL -#define substrait_RelCommon_Emit_DEFAULT NULL - -#define substrait_RelCommon_Hint_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, stats, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, constraint, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_RelCommon_Hint_CALLBACK NULL -#define substrait_RelCommon_Hint_DEFAULT NULL -#define substrait_RelCommon_Hint_stats_MSGTYPE substrait_RelCommon_Hint_Stats -#define substrait_RelCommon_Hint_constraint_MSGTYPE substrait_RelCommon_Hint_RuntimeConstraint -#define substrait_RelCommon_Hint_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_RelCommon_Hint_Stats_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, DOUBLE, row_count, 1) \ -X(a, POINTER, SINGULAR, DOUBLE, record_size, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_RelCommon_Hint_Stats_CALLBACK NULL -#define substrait_RelCommon_Hint_Stats_DEFAULT NULL -#define substrait_RelCommon_Hint_Stats_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_RelCommon_Hint_RuntimeConstraint_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_RelCommon_Hint_RuntimeConstraint_CALLBACK NULL -#define substrait_RelCommon_Hint_RuntimeConstraint_DEFAULT NULL -#define substrait_RelCommon_Hint_RuntimeConstraint_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_ReadRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, base_schema, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, filter, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, projection, 4) \ -X(a, POINTER, ONEOF, MESSAGE, (read_type,virtual_table,read_type.virtual_table), 5) \ -X(a, POINTER, ONEOF, MESSAGE, (read_type,local_files,read_type.local_files), 6) \ -X(a, POINTER, ONEOF, MESSAGE, (read_type,named_table,read_type.named_table), 7) \ -X(a, POINTER, ONEOF, MESSAGE, (read_type,extension_table,read_type.extension_table), 8) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_ReadRel_CALLBACK NULL -#define substrait_ReadRel_DEFAULT NULL -#define substrait_ReadRel_common_MSGTYPE substrait_RelCommon -#define substrait_ReadRel_base_schema_MSGTYPE substrait_NamedStruct -#define substrait_ReadRel_filter_MSGTYPE substrait_Expression -#define substrait_ReadRel_projection_MSGTYPE substrait_Expression_MaskExpression -#define substrait_ReadRel_read_type_virtual_table_MSGTYPE substrait_ReadRel_VirtualTable -#define substrait_ReadRel_read_type_local_files_MSGTYPE substrait_ReadRel_LocalFiles -#define substrait_ReadRel_read_type_named_table_MSGTYPE substrait_ReadRel_NamedTable -#define substrait_ReadRel_read_type_extension_table_MSGTYPE substrait_ReadRel_ExtensionTable -#define substrait_ReadRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_ReadRel_NamedTable_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, STRING, names, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_ReadRel_NamedTable_CALLBACK NULL -#define substrait_ReadRel_NamedTable_DEFAULT NULL -#define substrait_ReadRel_NamedTable_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_ReadRel_VirtualTable_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, values, 1) -#define substrait_ReadRel_VirtualTable_CALLBACK NULL -#define substrait_ReadRel_VirtualTable_DEFAULT NULL -#define substrait_ReadRel_VirtualTable_values_MSGTYPE substrait_Expression_Literal_Struct - -#define substrait_ReadRel_ExtensionTable_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, detail, 1) -#define substrait_ReadRel_ExtensionTable_CALLBACK NULL -#define substrait_ReadRel_ExtensionTable_DEFAULT NULL -#define substrait_ReadRel_ExtensionTable_detail_MSGTYPE substrait_Any - -#define substrait_ReadRel_LocalFiles_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, items, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_ReadRel_LocalFiles_CALLBACK NULL -#define substrait_ReadRel_LocalFiles_DEFAULT NULL -#define substrait_ReadRel_LocalFiles_items_MSGTYPE substrait_ReadRel_LocalFiles_FileOrFiles -#define substrait_ReadRel_LocalFiles_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_ReadRel_LocalFiles_FileOrFiles_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, STRING, (path_type,uri_path,path_type.uri_path), 1) \ -X(a, POINTER, ONEOF, STRING, (path_type,uri_path_glob,path_type.uri_path_glob), 2) \ -X(a, POINTER, ONEOF, STRING, (path_type,uri_file,path_type.uri_file), 3) \ -X(a, POINTER, ONEOF, STRING, (path_type,uri_folder,path_type.uri_folder), 4) \ -X(a, POINTER, SINGULAR, UENUM, format, 5) \ -X(a, POINTER, SINGULAR, UINT64, partition_index, 6) \ -X(a, POINTER, SINGULAR, UINT64, start, 7) \ -X(a, POINTER, SINGULAR, UINT64, length, 8) -#define substrait_ReadRel_LocalFiles_FileOrFiles_CALLBACK NULL -#define substrait_ReadRel_LocalFiles_FileOrFiles_DEFAULT NULL - -#define substrait_ProjectRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ -X(a, POINTER, REPEATED, MESSAGE, expressions, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_ProjectRel_CALLBACK NULL -#define substrait_ProjectRel_DEFAULT NULL -#define substrait_ProjectRel_common_MSGTYPE substrait_RelCommon -#define substrait_ProjectRel_input_MSGTYPE substrait_Rel -#define substrait_ProjectRel_expressions_MSGTYPE substrait_Expression -#define substrait_ProjectRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_JoinRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, left, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, right, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, expression, 4) \ -X(a, POINTER, OPTIONAL, MESSAGE, post_join_filter, 5) \ -X(a, POINTER, SINGULAR, UENUM, type, 6) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_JoinRel_CALLBACK NULL -#define substrait_JoinRel_DEFAULT NULL -#define substrait_JoinRel_common_MSGTYPE substrait_RelCommon -#define substrait_JoinRel_left_MSGTYPE substrait_Rel -#define substrait_JoinRel_right_MSGTYPE substrait_Rel -#define substrait_JoinRel_expression_MSGTYPE substrait_Expression -#define substrait_JoinRel_post_join_filter_MSGTYPE substrait_Expression -#define substrait_JoinRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_FetchRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ -X(a, POINTER, SINGULAR, INT64, offset, 3) \ -X(a, POINTER, SINGULAR, INT64, count, 4) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_FetchRel_CALLBACK NULL -#define substrait_FetchRel_DEFAULT NULL -#define substrait_FetchRel_common_MSGTYPE substrait_RelCommon -#define substrait_FetchRel_input_MSGTYPE substrait_Rel -#define substrait_FetchRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_AggregateRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ -X(a, POINTER, REPEATED, MESSAGE, groupings, 3) \ -X(a, POINTER, REPEATED, MESSAGE, measures, 4) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_AggregateRel_CALLBACK NULL -#define substrait_AggregateRel_DEFAULT NULL -#define substrait_AggregateRel_common_MSGTYPE substrait_RelCommon -#define substrait_AggregateRel_input_MSGTYPE substrait_Rel -#define substrait_AggregateRel_groupings_MSGTYPE substrait_AggregateRel_Grouping -#define substrait_AggregateRel_measures_MSGTYPE substrait_AggregateRel_Measure -#define substrait_AggregateRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_AggregateRel_Grouping_FIELDLIST(X, a) \ -X(a, POINTER, REPEATED, MESSAGE, grouping_expressions, 1) -#define substrait_AggregateRel_Grouping_CALLBACK NULL -#define substrait_AggregateRel_Grouping_DEFAULT NULL -#define substrait_AggregateRel_Grouping_grouping_expressions_MSGTYPE substrait_Expression - -#define substrait_AggregateRel_Measure_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, measure, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, filter, 2) -#define substrait_AggregateRel_Measure_CALLBACK NULL -#define substrait_AggregateRel_Measure_DEFAULT NULL -#define substrait_AggregateRel_Measure_measure_MSGTYPE substrait_AggregateFunction -#define substrait_AggregateRel_Measure_filter_MSGTYPE substrait_Expression - -#define substrait_SortRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ -X(a, POINTER, REPEATED, MESSAGE, sorts, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_SortRel_CALLBACK NULL -#define substrait_SortRel_DEFAULT NULL -#define substrait_SortRel_common_MSGTYPE substrait_RelCommon -#define substrait_SortRel_input_MSGTYPE substrait_Rel -#define substrait_SortRel_sorts_MSGTYPE substrait_SortField -#define substrait_SortRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_FilterRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, condition, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_FilterRel_CALLBACK NULL -#define substrait_FilterRel_DEFAULT NULL -#define substrait_FilterRel_common_MSGTYPE substrait_RelCommon -#define substrait_FilterRel_input_MSGTYPE substrait_Rel -#define substrait_FilterRel_condition_MSGTYPE substrait_Expression -#define substrait_FilterRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_SetRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, REPEATED, MESSAGE, inputs, 2) \ -X(a, POINTER, SINGULAR, UENUM, op, 3) \ -X(a, POINTER, OPTIONAL, MESSAGE, advanced_extension, 10) -#define substrait_SetRel_CALLBACK NULL -#define substrait_SetRel_DEFAULT NULL -#define substrait_SetRel_common_MSGTYPE substrait_RelCommon -#define substrait_SetRel_inputs_MSGTYPE substrait_Rel -#define substrait_SetRel_advanced_extension_MSGTYPE substrait_extensions_AdvancedExtension - -#define substrait_ExtensionSingleRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, detail, 3) -#define substrait_ExtensionSingleRel_CALLBACK NULL -#define substrait_ExtensionSingleRel_DEFAULT NULL -#define substrait_ExtensionSingleRel_common_MSGTYPE substrait_RelCommon -#define substrait_ExtensionSingleRel_input_MSGTYPE substrait_Rel -#define substrait_ExtensionSingleRel_detail_MSGTYPE substrait_Any - -#define substrait_ExtensionLeafRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, OPTIONAL, MESSAGE, detail, 2) -#define substrait_ExtensionLeafRel_CALLBACK NULL -#define substrait_ExtensionLeafRel_DEFAULT NULL -#define substrait_ExtensionLeafRel_common_MSGTYPE substrait_RelCommon -#define substrait_ExtensionLeafRel_detail_MSGTYPE substrait_Any - -#define substrait_ExtensionMultiRel_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, common, 1) \ -X(a, POINTER, REPEATED, MESSAGE, inputs, 2) \ -X(a, POINTER, OPTIONAL, MESSAGE, detail, 3) -#define substrait_ExtensionMultiRel_CALLBACK NULL -#define substrait_ExtensionMultiRel_DEFAULT NULL -#define substrait_ExtensionMultiRel_common_MSGTYPE substrait_RelCommon -#define substrait_ExtensionMultiRel_inputs_MSGTYPE substrait_Rel -#define substrait_ExtensionMultiRel_detail_MSGTYPE substrait_Any - -#define substrait_RelRoot_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, input, 1) \ -X(a, POINTER, REPEATED, STRING, names, 2) -#define substrait_RelRoot_CALLBACK NULL -#define substrait_RelRoot_DEFAULT NULL -#define substrait_RelRoot_input_MSGTYPE substrait_Rel - -#define substrait_Rel_FIELDLIST(X, a) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,read,rel_type.read), 1) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,filter,rel_type.filter), 2) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,fetch,rel_type.fetch), 3) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,aggregate,rel_type.aggregate), 4) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,sort,rel_type.sort), 5) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,join,rel_type.join), 6) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,project,rel_type.project), 7) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,set,rel_type.set), 8) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,extension_single,rel_type.extension_single), 9) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,extension_multi,rel_type.extension_multi), 10) \ -X(a, POINTER, ONEOF, MESSAGE, (rel_type,extension_leaf,rel_type.extension_leaf), 11) -#define substrait_Rel_CALLBACK NULL -#define substrait_Rel_DEFAULT NULL -#define substrait_Rel_rel_type_read_MSGTYPE substrait_ReadRel -#define substrait_Rel_rel_type_filter_MSGTYPE substrait_FilterRel -#define substrait_Rel_rel_type_fetch_MSGTYPE substrait_FetchRel -#define substrait_Rel_rel_type_aggregate_MSGTYPE substrait_AggregateRel -#define substrait_Rel_rel_type_sort_MSGTYPE substrait_SortRel -#define substrait_Rel_rel_type_join_MSGTYPE substrait_JoinRel -#define substrait_Rel_rel_type_project_MSGTYPE substrait_ProjectRel -#define substrait_Rel_rel_type_set_MSGTYPE substrait_SetRel -#define substrait_Rel_rel_type_extension_single_MSGTYPE substrait_ExtensionSingleRel -#define substrait_Rel_rel_type_extension_multi_MSGTYPE substrait_ExtensionMultiRel -#define substrait_Rel_rel_type_extension_leaf_MSGTYPE substrait_ExtensionLeafRel - -extern const pb_msgdesc_t substrait_RelCommon_msg; -extern const pb_msgdesc_t substrait_RelCommon_Direct_msg; -extern const pb_msgdesc_t substrait_RelCommon_Emit_msg; -extern const pb_msgdesc_t substrait_RelCommon_Hint_msg; -extern const pb_msgdesc_t substrait_RelCommon_Hint_Stats_msg; -extern const pb_msgdesc_t substrait_RelCommon_Hint_RuntimeConstraint_msg; -extern const pb_msgdesc_t substrait_ReadRel_msg; -extern const pb_msgdesc_t substrait_ReadRel_NamedTable_msg; -extern const pb_msgdesc_t substrait_ReadRel_VirtualTable_msg; -extern const pb_msgdesc_t substrait_ReadRel_ExtensionTable_msg; -extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_msg; -extern const pb_msgdesc_t substrait_ReadRel_LocalFiles_FileOrFiles_msg; -extern const pb_msgdesc_t substrait_ProjectRel_msg; -extern const pb_msgdesc_t substrait_JoinRel_msg; -extern const pb_msgdesc_t substrait_FetchRel_msg; -extern const pb_msgdesc_t substrait_AggregateRel_msg; -extern const pb_msgdesc_t substrait_AggregateRel_Grouping_msg; -extern const pb_msgdesc_t substrait_AggregateRel_Measure_msg; -extern const pb_msgdesc_t substrait_SortRel_msg; -extern const pb_msgdesc_t substrait_FilterRel_msg; -extern const pb_msgdesc_t substrait_SetRel_msg; -extern const pb_msgdesc_t substrait_ExtensionSingleRel_msg; -extern const pb_msgdesc_t substrait_ExtensionLeafRel_msg; -extern const pb_msgdesc_t substrait_ExtensionMultiRel_msg; -extern const pb_msgdesc_t substrait_RelRoot_msg; -extern const pb_msgdesc_t substrait_Rel_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define substrait_RelCommon_fields &substrait_RelCommon_msg -#define substrait_RelCommon_Direct_fields &substrait_RelCommon_Direct_msg -#define substrait_RelCommon_Emit_fields &substrait_RelCommon_Emit_msg -#define substrait_RelCommon_Hint_fields &substrait_RelCommon_Hint_msg -#define substrait_RelCommon_Hint_Stats_fields &substrait_RelCommon_Hint_Stats_msg -#define substrait_RelCommon_Hint_RuntimeConstraint_fields &substrait_RelCommon_Hint_RuntimeConstraint_msg -#define substrait_ReadRel_fields &substrait_ReadRel_msg -#define substrait_ReadRel_NamedTable_fields &substrait_ReadRel_NamedTable_msg -#define substrait_ReadRel_VirtualTable_fields &substrait_ReadRel_VirtualTable_msg -#define substrait_ReadRel_ExtensionTable_fields &substrait_ReadRel_ExtensionTable_msg -#define substrait_ReadRel_LocalFiles_fields &substrait_ReadRel_LocalFiles_msg -#define substrait_ReadRel_LocalFiles_FileOrFiles_fields &substrait_ReadRel_LocalFiles_FileOrFiles_msg -#define substrait_ProjectRel_fields &substrait_ProjectRel_msg -#define substrait_JoinRel_fields &substrait_JoinRel_msg -#define substrait_FetchRel_fields &substrait_FetchRel_msg -#define substrait_AggregateRel_fields &substrait_AggregateRel_msg -#define substrait_AggregateRel_Grouping_fields &substrait_AggregateRel_Grouping_msg -#define substrait_AggregateRel_Measure_fields &substrait_AggregateRel_Measure_msg -#define substrait_SortRel_fields &substrait_SortRel_msg -#define substrait_FilterRel_fields &substrait_FilterRel_msg -#define substrait_SetRel_fields &substrait_SetRel_msg -#define substrait_ExtensionSingleRel_fields &substrait_ExtensionSingleRel_msg -#define substrait_ExtensionLeafRel_fields &substrait_ExtensionLeafRel_msg -#define substrait_ExtensionMultiRel_fields &substrait_ExtensionMultiRel_msg -#define substrait_RelRoot_fields &substrait_RelRoot_msg -#define substrait_Rel_fields &substrait_Rel_msg - -/* Maximum encoded size of messages (where known) */ -/* substrait_RelCommon_size depends on runtime parameters */ -/* substrait_RelCommon_Emit_size depends on runtime parameters */ -/* substrait_RelCommon_Hint_size depends on runtime parameters */ -/* substrait_RelCommon_Hint_Stats_size depends on runtime parameters */ -/* substrait_RelCommon_Hint_RuntimeConstraint_size depends on runtime parameters */ -/* substrait_ReadRel_size depends on runtime parameters */ -/* substrait_ReadRel_NamedTable_size depends on runtime parameters */ -/* substrait_ReadRel_VirtualTable_size depends on runtime parameters */ -/* substrait_ReadRel_ExtensionTable_size depends on runtime parameters */ -/* substrait_ReadRel_LocalFiles_size depends on runtime parameters */ -/* substrait_ReadRel_LocalFiles_FileOrFiles_size depends on runtime parameters */ -/* substrait_ProjectRel_size depends on runtime parameters */ -/* substrait_JoinRel_size depends on runtime parameters */ -/* substrait_FetchRel_size depends on runtime parameters */ -/* substrait_AggregateRel_size depends on runtime parameters */ -/* substrait_AggregateRel_Grouping_size depends on runtime parameters */ -/* substrait_AggregateRel_Measure_size depends on runtime parameters */ -/* substrait_SortRel_size depends on runtime parameters */ -/* substrait_FilterRel_size depends on runtime parameters */ -/* substrait_SetRel_size depends on runtime parameters */ -/* substrait_ExtensionSingleRel_size depends on runtime parameters */ -/* substrait_ExtensionLeafRel_size depends on runtime parameters */ -/* substrait_ExtensionMultiRel_size depends on runtime parameters */ -/* substrait_RelRoot_size depends on runtime parameters */ -/* substrait_Rel_size depends on runtime parameters */ -#define substrait_RelCommon_Direct_size 0 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/substrait/type.pb.h b/src/substrait/type.pb.h index f3b0a79d..5bcb4d41 100644 --- a/src/substrait/type.pb.h +++ b/src/substrait/type.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_TYPE_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_TYPE_PB_H_INCLUDED @@ -19,8 +19,8 @@ typedef enum _substrait_Type_Nullability { /* Struct definitions */ typedef struct _substrait_NamedStruct { pb_size_t names_count; - char **names; - struct _substrait_Type_Struct *struct_; + char **names; + struct _substrait_Type_Struct *struct_; } substrait_NamedStruct; typedef struct _substrait_Type { @@ -48,14 +48,19 @@ typedef struct _substrait_Type { struct _substrait_Type_List *list; struct _substrait_Type_Map *map; struct _substrait_Type_TimestampTZ *timestamp_tz; + struct _substrait_Type_UserDefined *user_defined; + /* Deprecated in favor of user_defined, which allows nullability and + variations to be specified. If user_defined_type_reference is + encountered, treat it as being non-nullable and having the default + variation. */ uint32_t *user_defined_type_reference; struct _substrait_Type_UUID *uuid; - } kind; + } kind; } substrait_Type; typedef struct _substrait_Type_Binary { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Binary; /* A message for modeling name/type pairs. @@ -79,123 +84,129 @@ typedef struct _substrait_Type_Binary { * Map keys should be traversed first, then values when producing/consuming */ typedef struct _substrait_Type_Boolean { /* list of names in dfs order */ - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Boolean; typedef struct _substrait_Type_Date { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Date; typedef struct _substrait_Type_Decimal { - int32_t *scale; - int32_t *precision; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + int32_t *scale; + int32_t *precision; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Decimal; typedef struct _substrait_Type_FP32 { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_FP32; typedef struct _substrait_Type_FP64 { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_FP64; typedef struct _substrait_Type_FixedBinary { - int32_t *length; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + int32_t *length; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_FixedBinary; typedef struct _substrait_Type_FixedChar { - int32_t *length; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + int32_t *length; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_FixedChar; typedef struct _substrait_Type_I16 { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_I16; typedef struct _substrait_Type_I32 { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_I32; typedef struct _substrait_Type_I64 { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_I64; typedef struct _substrait_Type_I8 { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_I8; typedef struct _substrait_Type_IntervalDay { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_IntervalDay; typedef struct _substrait_Type_IntervalYear { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_IntervalYear; typedef struct _substrait_Type_List { - struct _substrait_Type *type; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + struct _substrait_Type *type; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_List; typedef struct _substrait_Type_Map { - struct _substrait_Type *key; - struct _substrait_Type *value; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + struct _substrait_Type *key; + struct _substrait_Type *value; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Map; typedef struct _substrait_Type_String { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_String; typedef struct _substrait_Type_Struct { pb_size_t types_count; - struct _substrait_Type *types; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + struct _substrait_Type *types; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Struct; typedef struct _substrait_Type_Time { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Time; typedef struct _substrait_Type_Timestamp { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_Timestamp; typedef struct _substrait_Type_TimestampTZ { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_TimestampTZ; typedef struct _substrait_Type_UUID { - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_UUID; +typedef struct _substrait_Type_UserDefined { + uint32_t *type_reference; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; +} substrait_Type_UserDefined; + typedef struct _substrait_Type_VarChar { - int32_t *length; - uint32_t *type_variation_reference; - substrait_Type_Nullability *nullability; + int32_t *length; + uint32_t *type_variation_reference; + substrait_Type_Nullability *nullability; } substrait_Type_VarChar; @@ -234,6 +245,7 @@ extern "C" { #define substrait_Type_Struct_init_default {0, NULL, NULL, NULL} #define substrait_Type_List_init_default {NULL, NULL, NULL} #define substrait_Type_Map_init_default {NULL, NULL, NULL, NULL} +#define substrait_Type_UserDefined_init_default {NULL, NULL, NULL} #define substrait_NamedStruct_init_default {0, NULL, NULL} #define substrait_Type_init_zero {0, {NULL}} #define substrait_Type_Boolean_init_zero {NULL, NULL} @@ -259,6 +271,7 @@ extern "C" { #define substrait_Type_Struct_init_zero {0, NULL, NULL, NULL} #define substrait_Type_List_init_zero {NULL, NULL, NULL} #define substrait_Type_Map_init_zero {NULL, NULL, NULL, NULL} +#define substrait_Type_UserDefined_init_zero {NULL, NULL, NULL} #define substrait_NamedStruct_init_zero {0, NULL, NULL} /* Field tags (for use in manual encoding/decoding) */ @@ -286,6 +299,7 @@ extern "C" { #define substrait_Type_list_tag 27 #define substrait_Type_map_tag 28 #define substrait_Type_timestamp_tz_tag 29 +#define substrait_Type_user_defined_tag 30 #define substrait_Type_user_defined_type_reference_tag 31 #define substrait_Type_uuid_tag 32 #define substrait_Type_Binary_type_variation_reference_tag 1 @@ -340,6 +354,9 @@ extern "C" { #define substrait_Type_TimestampTZ_nullability_tag 2 #define substrait_Type_UUID_type_variation_reference_tag 1 #define substrait_Type_UUID_nullability_tag 2 +#define substrait_Type_UserDefined_type_reference_tag 1 +#define substrait_Type_UserDefined_type_variation_reference_tag 2 +#define substrait_Type_UserDefined_nullability_tag 3 #define substrait_Type_VarChar_length_tag 1 #define substrait_Type_VarChar_type_variation_reference_tag 2 #define substrait_Type_VarChar_nullability_tag 3 @@ -368,6 +385,7 @@ X(a, POINTER, ONEOF, MESSAGE, (kind,struct_,kind.struct_), 25) \ X(a, POINTER, ONEOF, MESSAGE, (kind,list,kind.list), 27) \ X(a, POINTER, ONEOF, MESSAGE, (kind,map,kind.map), 28) \ X(a, POINTER, ONEOF, MESSAGE, (kind,timestamp_tz,kind.timestamp_tz), 29) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,user_defined,kind.user_defined), 30) \ X(a, POINTER, ONEOF, UINT32, (kind,user_defined_type_reference,kind.user_defined_type_reference), 31) \ X(a, POINTER, ONEOF, MESSAGE, (kind,uuid,kind.uuid), 32) #define substrait_Type_CALLBACK NULL @@ -394,6 +412,7 @@ X(a, POINTER, ONEOF, MESSAGE, (kind,uuid,kind.uuid), 32) #define substrait_Type_kind_list_MSGTYPE substrait_Type_List #define substrait_Type_kind_map_MSGTYPE substrait_Type_Map #define substrait_Type_kind_timestamp_tz_MSGTYPE substrait_Type_TimestampTZ +#define substrait_Type_kind_user_defined_MSGTYPE substrait_Type_UserDefined #define substrait_Type_kind_uuid_MSGTYPE substrait_Type_UUID #define substrait_Type_Boolean_FIELDLIST(X, a) \ @@ -547,6 +566,13 @@ X(a, POINTER, SINGULAR, UENUM, nullability, 4) #define substrait_Type_Map_key_MSGTYPE substrait_Type #define substrait_Type_Map_value_MSGTYPE substrait_Type +#define substrait_Type_UserDefined_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, type_reference, 1) \ +X(a, POINTER, SINGULAR, UINT32, type_variation_reference, 2) \ +X(a, POINTER, SINGULAR, UENUM, nullability, 3) +#define substrait_Type_UserDefined_CALLBACK NULL +#define substrait_Type_UserDefined_DEFAULT NULL + #define substrait_NamedStruct_FIELDLIST(X, a) \ X(a, POINTER, REPEATED, STRING, names, 1) \ X(a, POINTER, OPTIONAL, MESSAGE, struct_, 2) @@ -578,6 +604,7 @@ extern const pb_msgdesc_t substrait_Type_Decimal_msg; extern const pb_msgdesc_t substrait_Type_Struct_msg; extern const pb_msgdesc_t substrait_Type_List_msg; extern const pb_msgdesc_t substrait_Type_Map_msg; +extern const pb_msgdesc_t substrait_Type_UserDefined_msg; extern const pb_msgdesc_t substrait_NamedStruct_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ @@ -605,6 +632,7 @@ extern const pb_msgdesc_t substrait_NamedStruct_msg; #define substrait_Type_Struct_fields &substrait_Type_Struct_msg #define substrait_Type_List_fields &substrait_Type_List_msg #define substrait_Type_Map_fields &substrait_Type_Map_msg +#define substrait_Type_UserDefined_fields &substrait_Type_UserDefined_msg #define substrait_NamedStruct_fields &substrait_NamedStruct_msg /* Maximum encoded size of messages (where known) */ @@ -632,6 +660,7 @@ extern const pb_msgdesc_t substrait_NamedStruct_msg; /* substrait_Type_Struct_size depends on runtime parameters */ /* substrait_Type_List_size depends on runtime parameters */ /* substrait_Type_Map_size depends on runtime parameters */ +/* substrait_Type_UserDefined_size depends on runtime parameters */ /* substrait_NamedStruct_size depends on runtime parameters */ #ifdef __cplusplus diff --git a/src/substrait/type_expressions.pb.h b/src/substrait/type_expressions.pb.h index 84f6e0b0..523855b1 100644 --- a/src/substrait/type_expressions.pb.h +++ b/src/substrait/type_expressions.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #ifndef PB_SUBSTRAIT_SUBSTRAIT_TYPE_EXPRESSIONS_PB_H_INCLUDED #define PB_SUBSTRAIT_SUBSTRAIT_TYPE_EXPRESSIONS_PB_H_INCLUDED @@ -58,6 +58,10 @@ typedef struct _substrait_DerivationExpression { struct _substrait_DerivationExpression_ExpressionList *list; struct _substrait_DerivationExpression_ExpressionMap *map; struct _substrait_Type_TimestampTZ *timestamp_tz; + struct _substrait_DerivationExpression_ExpressionUserDefined *user_defined; + /* Deprecated in favor of user_defined, which allows nullability and + variations to be specified. If user_defined_pointer is encountered, + treat it as being non-nullable and having the default variation. */ uint32_t *user_defined_pointer; struct _substrait_Type_UUID *uuid; char *type_parameter_name; @@ -65,88 +69,94 @@ typedef struct _substrait_DerivationExpression { int32_t *integer_literal; struct _substrait_DerivationExpression_UnaryOp *unary_op; struct _substrait_DerivationExpression_BinaryOp *binary_op; - struct _substrait_DerivationExpression_IfElse *if_else; + struct _substrait_DerivationExpression_IfElse *if_else_; struct _substrait_DerivationExpression_ReturnProgram *return_program; - } kind; + } kind; } substrait_DerivationExpression; typedef struct _substrait_DerivationExpression_BinaryOp { - substrait_DerivationExpression_BinaryOp_BinaryOpType *op_type; - struct _substrait_DerivationExpression *arg1; - struct _substrait_DerivationExpression *arg2; + substrait_DerivationExpression_BinaryOp_BinaryOpType *op_type; + struct _substrait_DerivationExpression *arg1; + struct _substrait_DerivationExpression *arg2; } substrait_DerivationExpression_BinaryOp; typedef struct _substrait_DerivationExpression_ExpressionDecimal { - struct _substrait_DerivationExpression *scale; - struct _substrait_DerivationExpression *precision; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *scale; + struct _substrait_DerivationExpression *precision; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionDecimal; typedef struct _substrait_DerivationExpression_ExpressionFixedBinary { - struct _substrait_DerivationExpression *length; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *length; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionFixedBinary; typedef struct _substrait_DerivationExpression_ExpressionFixedChar { - struct _substrait_DerivationExpression *length; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *length; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionFixedChar; typedef struct _substrait_DerivationExpression_ExpressionList { - struct _substrait_DerivationExpression *type; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *type; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionList; typedef struct _substrait_DerivationExpression_ExpressionMap { - struct _substrait_DerivationExpression *key; - struct _substrait_DerivationExpression *value; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *key; + struct _substrait_DerivationExpression *value; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionMap; typedef struct _substrait_DerivationExpression_ExpressionNamedStruct { pb_size_t names_count; - char **names; - struct _substrait_DerivationExpression_ExpressionStruct *struct_; + char **names; + struct _substrait_DerivationExpression_ExpressionStruct *struct_; } substrait_DerivationExpression_ExpressionNamedStruct; typedef struct _substrait_DerivationExpression_ExpressionStruct { pb_size_t types_count; - struct _substrait_DerivationExpression *types; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *types; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionStruct; +typedef struct _substrait_DerivationExpression_ExpressionUserDefined { + uint32_t *type_pointer; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; +} substrait_DerivationExpression_ExpressionUserDefined; + typedef struct _substrait_DerivationExpression_ExpressionVarChar { - struct _substrait_DerivationExpression *length; - uint32_t *variation_pointer; - substrait_Type_Nullability *nullability; + struct _substrait_DerivationExpression *length; + uint32_t *variation_pointer; + substrait_Type_Nullability *nullability; } substrait_DerivationExpression_ExpressionVarChar; typedef struct _substrait_DerivationExpression_IfElse { - struct _substrait_DerivationExpression *if_condition; - struct _substrait_DerivationExpression *if_return; - struct _substrait_DerivationExpression *else_return; + struct _substrait_DerivationExpression *if_condition; + struct _substrait_DerivationExpression *if_return; + struct _substrait_DerivationExpression *else_return; } substrait_DerivationExpression_IfElse; typedef struct _substrait_DerivationExpression_ReturnProgram { pb_size_t assignments_count; - struct _substrait_DerivationExpression_ReturnProgram_Assignment *assignments; - struct _substrait_DerivationExpression *final_expression; + struct _substrait_DerivationExpression_ReturnProgram_Assignment *assignments; + struct _substrait_DerivationExpression *final_expression; } substrait_DerivationExpression_ReturnProgram; typedef struct _substrait_DerivationExpression_ReturnProgram_Assignment { - char *name; - struct _substrait_DerivationExpression *expression; + char *name; + struct _substrait_DerivationExpression *expression; } substrait_DerivationExpression_ReturnProgram_Assignment; typedef struct _substrait_DerivationExpression_UnaryOp { - substrait_DerivationExpression_UnaryOp_UnaryOpType *op_type; - struct _substrait_DerivationExpression *arg; + substrait_DerivationExpression_UnaryOp_UnaryOpType *op_type; + struct _substrait_DerivationExpression *arg; } substrait_DerivationExpression_UnaryOp; @@ -174,6 +184,7 @@ extern "C" { #define substrait_DerivationExpression_ExpressionNamedStruct_init_default {0, NULL, NULL} #define substrait_DerivationExpression_ExpressionList_init_default {NULL, NULL, NULL} #define substrait_DerivationExpression_ExpressionMap_init_default {NULL, NULL, NULL, NULL} +#define substrait_DerivationExpression_ExpressionUserDefined_init_default {NULL, NULL, NULL} #define substrait_DerivationExpression_IfElse_init_default {NULL, NULL, NULL} #define substrait_DerivationExpression_UnaryOp_init_default {NULL, NULL} #define substrait_DerivationExpression_BinaryOp_init_default {NULL, NULL, NULL} @@ -188,6 +199,7 @@ extern "C" { #define substrait_DerivationExpression_ExpressionNamedStruct_init_zero {0, NULL, NULL} #define substrait_DerivationExpression_ExpressionList_init_zero {NULL, NULL, NULL} #define substrait_DerivationExpression_ExpressionMap_init_zero {NULL, NULL, NULL, NULL} +#define substrait_DerivationExpression_ExpressionUserDefined_init_zero {NULL, NULL, NULL} #define substrait_DerivationExpression_IfElse_init_zero {NULL, NULL, NULL} #define substrait_DerivationExpression_UnaryOp_init_zero {NULL, NULL} #define substrait_DerivationExpression_BinaryOp_init_zero {NULL, NULL, NULL} @@ -217,6 +229,7 @@ extern "C" { #define substrait_DerivationExpression_list_tag 27 #define substrait_DerivationExpression_map_tag 28 #define substrait_DerivationExpression_timestamp_tz_tag 29 +#define substrait_DerivationExpression_user_defined_tag 30 #define substrait_DerivationExpression_user_defined_pointer_tag 31 #define substrait_DerivationExpression_uuid_tag 32 #define substrait_DerivationExpression_type_parameter_name_tag 33 @@ -224,7 +237,7 @@ extern "C" { #define substrait_DerivationExpression_integer_literal_tag 35 #define substrait_DerivationExpression_unary_op_tag 36 #define substrait_DerivationExpression_binary_op_tag 37 -#define substrait_DerivationExpression_if_else_tag 38 +#define substrait_DerivationExpression_if_else__tag 38 #define substrait_DerivationExpression_return_program_tag 39 #define substrait_DerivationExpression_BinaryOp_op_type_tag 1 #define substrait_DerivationExpression_BinaryOp_arg1_tag 2 @@ -251,6 +264,9 @@ extern "C" { #define substrait_DerivationExpression_ExpressionStruct_types_tag 1 #define substrait_DerivationExpression_ExpressionStruct_variation_pointer_tag 2 #define substrait_DerivationExpression_ExpressionStruct_nullability_tag 3 +#define substrait_DerivationExpression_ExpressionUserDefined_type_pointer_tag 1 +#define substrait_DerivationExpression_ExpressionUserDefined_variation_pointer_tag 2 +#define substrait_DerivationExpression_ExpressionUserDefined_nullability_tag 3 #define substrait_DerivationExpression_ExpressionVarChar_length_tag 1 #define substrait_DerivationExpression_ExpressionVarChar_variation_pointer_tag 2 #define substrait_DerivationExpression_ExpressionVarChar_nullability_tag 3 @@ -288,6 +304,7 @@ X(a, POINTER, ONEOF, MESSAGE, (kind,struct_,kind.struct_), 25) \ X(a, POINTER, ONEOF, MESSAGE, (kind,list,kind.list), 27) \ X(a, POINTER, ONEOF, MESSAGE, (kind,map,kind.map), 28) \ X(a, POINTER, ONEOF, MESSAGE, (kind,timestamp_tz,kind.timestamp_tz), 29) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,user_defined,kind.user_defined), 30) \ X(a, POINTER, ONEOF, UINT32, (kind,user_defined_pointer,kind.user_defined_pointer), 31) \ X(a, POINTER, ONEOF, MESSAGE, (kind,uuid,kind.uuid), 32) \ X(a, POINTER, ONEOF, STRING, (kind,type_parameter_name,kind.type_parameter_name), 33) \ @@ -295,7 +312,7 @@ X(a, POINTER, ONEOF, STRING, (kind,integer_parameter_name,kind.integer_par X(a, POINTER, ONEOF, INT32, (kind,integer_literal,kind.integer_literal), 35) \ X(a, POINTER, ONEOF, MESSAGE, (kind,unary_op,kind.unary_op), 36) \ X(a, POINTER, ONEOF, MESSAGE, (kind,binary_op,kind.binary_op), 37) \ -X(a, POINTER, ONEOF, MESSAGE, (kind,if_else,kind.if_else), 38) \ +X(a, POINTER, ONEOF, MESSAGE, (kind,if_else_,kind.if_else_), 38) \ X(a, POINTER, ONEOF, MESSAGE, (kind,return_program,kind.return_program), 39) #define substrait_DerivationExpression_CALLBACK NULL #define substrait_DerivationExpression_DEFAULT NULL @@ -321,10 +338,11 @@ X(a, POINTER, ONEOF, MESSAGE, (kind,return_program,kind.return_program), 3 #define substrait_DerivationExpression_kind_list_MSGTYPE substrait_DerivationExpression_ExpressionList #define substrait_DerivationExpression_kind_map_MSGTYPE substrait_DerivationExpression_ExpressionMap #define substrait_DerivationExpression_kind_timestamp_tz_MSGTYPE substrait_Type_TimestampTZ +#define substrait_DerivationExpression_kind_user_defined_MSGTYPE substrait_DerivationExpression_ExpressionUserDefined #define substrait_DerivationExpression_kind_uuid_MSGTYPE substrait_Type_UUID #define substrait_DerivationExpression_kind_unary_op_MSGTYPE substrait_DerivationExpression_UnaryOp #define substrait_DerivationExpression_kind_binary_op_MSGTYPE substrait_DerivationExpression_BinaryOp -#define substrait_DerivationExpression_kind_if_else_MSGTYPE substrait_DerivationExpression_IfElse +#define substrait_DerivationExpression_kind_if_else__MSGTYPE substrait_DerivationExpression_IfElse #define substrait_DerivationExpression_kind_return_program_MSGTYPE substrait_DerivationExpression_ReturnProgram #define substrait_DerivationExpression_ExpressionFixedChar_FIELDLIST(X, a) \ @@ -394,6 +412,13 @@ X(a, POINTER, SINGULAR, UENUM, nullability, 4) #define substrait_DerivationExpression_ExpressionMap_key_MSGTYPE substrait_DerivationExpression #define substrait_DerivationExpression_ExpressionMap_value_MSGTYPE substrait_DerivationExpression +#define substrait_DerivationExpression_ExpressionUserDefined_FIELDLIST(X, a) \ +X(a, POINTER, SINGULAR, UINT32, type_pointer, 1) \ +X(a, POINTER, SINGULAR, UINT32, variation_pointer, 2) \ +X(a, POINTER, SINGULAR, UENUM, nullability, 3) +#define substrait_DerivationExpression_ExpressionUserDefined_CALLBACK NULL +#define substrait_DerivationExpression_ExpressionUserDefined_DEFAULT NULL + #define substrait_DerivationExpression_IfElse_FIELDLIST(X, a) \ X(a, POINTER, OPTIONAL, MESSAGE, if_condition, 1) \ X(a, POINTER, OPTIONAL, MESSAGE, if_return, 2) \ @@ -444,6 +469,7 @@ extern const pb_msgdesc_t substrait_DerivationExpression_ExpressionStruct_msg; extern const pb_msgdesc_t substrait_DerivationExpression_ExpressionNamedStruct_msg; extern const pb_msgdesc_t substrait_DerivationExpression_ExpressionList_msg; extern const pb_msgdesc_t substrait_DerivationExpression_ExpressionMap_msg; +extern const pb_msgdesc_t substrait_DerivationExpression_ExpressionUserDefined_msg; extern const pb_msgdesc_t substrait_DerivationExpression_IfElse_msg; extern const pb_msgdesc_t substrait_DerivationExpression_UnaryOp_msg; extern const pb_msgdesc_t substrait_DerivationExpression_BinaryOp_msg; @@ -460,6 +486,7 @@ extern const pb_msgdesc_t substrait_DerivationExpression_ReturnProgram_Assignmen #define substrait_DerivationExpression_ExpressionNamedStruct_fields &substrait_DerivationExpression_ExpressionNamedStruct_msg #define substrait_DerivationExpression_ExpressionList_fields &substrait_DerivationExpression_ExpressionList_msg #define substrait_DerivationExpression_ExpressionMap_fields &substrait_DerivationExpression_ExpressionMap_msg +#define substrait_DerivationExpression_ExpressionUserDefined_fields &substrait_DerivationExpression_ExpressionUserDefined_msg #define substrait_DerivationExpression_IfElse_fields &substrait_DerivationExpression_IfElse_msg #define substrait_DerivationExpression_UnaryOp_fields &substrait_DerivationExpression_UnaryOp_msg #define substrait_DerivationExpression_BinaryOp_fields &substrait_DerivationExpression_BinaryOp_msg @@ -476,6 +503,7 @@ extern const pb_msgdesc_t substrait_DerivationExpression_ReturnProgram_Assignmen /* substrait_DerivationExpression_ExpressionNamedStruct_size depends on runtime parameters */ /* substrait_DerivationExpression_ExpressionList_size depends on runtime parameters */ /* substrait_DerivationExpression_ExpressionMap_size depends on runtime parameters */ +/* substrait_DerivationExpression_ExpressionUserDefined_size depends on runtime parameters */ /* substrait_DerivationExpression_IfElse_size depends on runtime parameters */ /* substrait_DerivationExpression_UnaryOp_size depends on runtime parameters */ /* substrait_DerivationExpression_BinaryOp_size depends on runtime parameters */ diff --git a/src/type.pb.c b/src/type.pb.c index cc9ad3a5..a8622879 100644 --- a/src/type.pb.c +++ b/src/type.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/type.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -78,6 +78,9 @@ PB_BIND(substrait_Type_List, substrait_Type_List, AUTO) PB_BIND(substrait_Type_Map, substrait_Type_Map, AUTO) +PB_BIND(substrait_Type_UserDefined, substrait_Type_UserDefined, AUTO) + + PB_BIND(substrait_NamedStruct, substrait_NamedStruct, AUTO) diff --git a/src/type_expressions.pb.c b/src/type_expressions.pb.c index 4380091f..dca0a50d 100644 --- a/src/type_expressions.pb.c +++ b/src/type_expressions.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.5 */ +/* Generated by nanopb-0.4.6 */ #include "substrait/type_expressions.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -33,6 +33,9 @@ PB_BIND(substrait_DerivationExpression_ExpressionList, substrait_DerivationExpre PB_BIND(substrait_DerivationExpression_ExpressionMap, substrait_DerivationExpression_ExpressionMap, AUTO) +PB_BIND(substrait_DerivationExpression_ExpressionUserDefined, substrait_DerivationExpression_ExpressionUserDefined, AUTO) + + PB_BIND(substrait_DerivationExpression_IfElse, substrait_DerivationExpression_IfElse, AUTO) diff --git a/tests/testthat/test-aggregate-rel.R b/tests/testthat/test-aggregate-rel.R index c9fd8915..0923059c 100644 --- a/tests/testthat/test-aggregate-rel.R +++ b/tests/testthat/test-aggregate-rel.R @@ -36,7 +36,7 @@ test_that("substrait_aggregate() can evaluate a simple aggregation expression", "sum" ) expect_s3_class( - agg$rel$aggregate$measures[[1]]$measure$args[[1]]$scalar_function, + agg$rel$aggregate$measures[[1]]$measure$arguments[[1]]$value$scalar_function, "substrait_Expression_ScalarFunction" ) expect_identical(agg$schema$names, c("a", "c")) diff --git a/tests/testthat/test-compiler.R b/tests/testthat/test-compiler.R index 6c349887..c46453ac 100644 --- a/tests/testthat/test-compiler.R +++ b/tests/testthat/test-compiler.R @@ -127,18 +127,61 @@ test_that("SubstraitCompiler$resolve_function() works", { compiler$resolve_function( "some_fun", list(1L), - substrait$Expression$ScalarFunction$create() + substrait$Expression$ScalarFunction$create(), + output_type = NULL ), substrait$Expression$ScalarFunction$create( function_reference = 1, - args = list( - substrait$Expression$create( - literal = substrait$Expression$Literal$create(i32 = 1L) + arguments = list( + substrait$FunctionArgument$create( + value = substrait$Expression$create( + literal = substrait$Expression$Literal$create(i32 = 1L) + ) ) ), output_type = substrait$Type$create() ) ) + + expect_identical( + compiler$resolve_function( + "some_fun", + list(1L), + substrait$Expression$ScalarFunction$create(), + output_type = substrait_boolean() + ), + substrait$Expression$ScalarFunction$create( + function_reference = 1, + arguments = list( + substrait$FunctionArgument$create( + value = substrait$Expression$create( + literal = substrait$Expression$Literal$create(i32 = 1L) + ) + ) + ), + output_type = substrait_boolean() + ) + ) + + expect_identical( + compiler$resolve_function( + "some_fun", + list(1L), + substrait$Expression$ScalarFunction$create(), + output_type = function(x) x + ), + substrait$Expression$ScalarFunction$create( + function_reference = 1, + arguments = list( + substrait$FunctionArgument$create( + value = substrait$Expression$create( + literal = substrait$Expression$Literal$create(i32 = 1L) + ) + ) + ), + output_type = substrait_i32() + ) + ) }) test_that("SubstraitCompiler$plan() includes rel and extensions", { diff --git a/tests/testthat/test-expression.R b/tests/testthat/test-expression.R index d052bc40..8c1fa15f 100644 --- a/tests/testthat/test-expression.R +++ b/tests/testthat/test-expression.R @@ -64,9 +64,11 @@ test_that("quosures with calls can be translated to Expressions", { substrait$Expression$create( scalar_function = substrait$Expression$ScalarFunction$create( function_reference = 2, - args = list( - substrait$Expression$create( - literal = substrait$Expression$Literal$create(i32 = 5L) + arguments = list( + substrait$FunctionArgument$create( + value = substrait$Expression$create( + literal = substrait$Expression$Literal$create(i32 = 5L) + ) ) ), output_type = substrait$Type$create() @@ -79,9 +81,11 @@ test_that("quosures with calls can be translated to Expressions", { substrait$Expression$create( scalar_function = substrait$Expression$ScalarFunction$create( function_reference = 3, - args = list( - substrait$Expression$create( - literal = substrait$Expression$Literal$create(i32 = 5L) + arguments = list( + substrait$FunctionArgument$create( + value = substrait$Expression$create( + literal = substrait$Expression$Literal$create(i32 = 5L) + ) ) ), output_type = substrait$Type$create() diff --git a/tests/testthat/test-pkg-arrow.R b/tests/testthat/test-pkg-arrow.R index cc77732f..523066c7 100644 --- a/tests/testthat/test-pkg-arrow.R +++ b/tests/testthat/test-pkg-arrow.R @@ -66,6 +66,7 @@ test_that("ArrowSubstraitCompiler can evaluate a plan with one relation", { test_that("ArrowSubstraitCompiler can evaluate a plan with a field reference", { skip_if_not(has_arrow_with_substrait()) + skip("Until https://github.com/apache/arrow/pull/13914 merges") df <- data.frame( letter = letters[1:5], @@ -73,7 +74,7 @@ test_that("ArrowSubstraitCompiler can evaluate a plan with a field reference", { ) compiler <- arrow_substrait_compiler(df) - result <- substrait_project(compiler, number) + result <- substrait_select(compiler, number) expect_identical( as.data.frame(as.data.frame(result$evaluate())), @@ -83,6 +84,7 @@ test_that("ArrowSubstraitCompiler can evaluate a plan with a field reference", { test_that("ArrowSubstraitCompiler can evaluate a project with a function call", { skip_if_not(has_arrow_with_substrait()) + skip("Until https://github.com/apache/arrow/pull/13914 merges") df <- data.frame( letter = letters[1:5], @@ -90,7 +92,7 @@ test_that("ArrowSubstraitCompiler can evaluate a project with a function call", ) compiler <- arrow_substrait_compiler(df) - result <- substrait_project(compiler, added = number + 1L) + result <- substrait_select(compiler, added = number + 1L) expect_identical( as.data.frame(as.data.frame(result$evaluate())), diff --git a/tests/testthat/test-pkg-dplyr.R b/tests/testthat/test-pkg-dplyr.R index 82e18cc3..9cff2d09 100644 --- a/tests/testthat/test-pkg-dplyr.R +++ b/tests/testthat/test-pkg-dplyr.R @@ -1,5 +1,5 @@ -test_that("dplyr::select() for substrait_compiler wraps substrait_project()", { +test_that("dplyr::select() for substrait_compiler wraps substrait_select()", { skip_if_not_installed("dplyr") tbl <- data.frame(col1 = 1, col2 = "one") @@ -9,22 +9,22 @@ test_that("dplyr::select() for substrait_compiler wraps substrait_project()", { expect_identical( dplyr::select(compiler, col1, col2), - substrait_project(compiler, col1, col2) + substrait_select(compiler, col1, col2) ) expect_identical( dplyr::select(compiler, col1, col2), - substrait_project(compiler, col1, col2) + substrait_select(compiler, col1, col2) ) expect_identical( dplyr::select(compiler, everything()), - substrait_project(compiler, col1, col2) + substrait_select(compiler, col1, col2) ) expect_identical( dplyr::select(compiler, where(is.numeric)), - substrait_project(compiler, col1) + substrait_select(compiler, col1) ) }) @@ -50,7 +50,7 @@ test_that("rename() for substrait_compiler renames columns", { expect_identical( dplyr::rename(compiler, col1_renamed = col1), - substrait_project(compiler, col1_renamed = col1, col2) + substrait_select(compiler, col1_renamed = col1, col2) ) }) @@ -62,7 +62,7 @@ test_that("rename_with() for substrait_compiler renames columns using a function expect_identical( dplyr::rename_with(compiler, toupper), - substrait_project(compiler, "COL1" = col1, "COL2" = col2) + substrait_select(compiler, "COL1" = col1, "COL2" = col2) ) }) @@ -78,7 +78,7 @@ test_that("filter() for substrait_compiler wraps substrait_filter()", { ) }) -test_that("mutate() for substrait_compiler wraps substrait_project()", { +test_that("mutate() for substrait_compiler wraps substrait_select()", { skip_if_not_installed("dplyr") tbl <- data.frame(col1 = 1, col2 = "one") @@ -86,11 +86,11 @@ test_that("mutate() for substrait_compiler wraps substrait_project()", { expect_identical( dplyr::mutate(compiler, col1 > 0), - substrait_project(compiler, col1, col2, col1 > 0) + substrait_select(compiler, col1, col2, col1 > 0) ) }) -test_that("transmute() for substrait_compiler wraps substrait_project()", { +test_that("transmute() for substrait_compiler wraps substrait_select()", { skip_if_not_installed("dplyr") tbl <- data.frame(col1 = 1, col2 = "one") @@ -98,7 +98,7 @@ test_that("transmute() for substrait_compiler wraps substrait_project()", { expect_identical( dplyr::transmute(compiler, col1 > 0), - substrait_project(compiler, col1 > 0) + substrait_select(compiler, col1 > 0) ) }) @@ -218,6 +218,6 @@ test_that("relocate() for substrait_compiler reorders columns", { expect_identical( dplyr::relocate(compiler, col1, .after = col2), - substrait_project(compiler, col2, col1) + substrait_select(compiler, col2, col1) ) }) diff --git a/tests/testthat/test-pkg-duckdb.R b/tests/testthat/test-pkg-duckdb.R index ed102af6..7192760d 100644 --- a/tests/testthat/test-pkg-duckdb.R +++ b/tests/testthat/test-pkg-duckdb.R @@ -224,19 +224,6 @@ test_that("duckdb can roundtrip a substrait plan", { ) }) -test_that("blob encoder works", { - expect_identical( - duckdb_encode_blob(as.raw(1:5)), - "'\\x01\\x02\\x03\\x04\\x05'::BLOB" - ) - - skip_if_not(has_duckdb_with_substrait()) - tbl <- query_duckdb_with_substrait( - paste0("SELECT ", duckdb_encode_blob(as.raw(1:5)), " as col") - ) - expect_identical(tbl$col[[1]], as.raw(1:5)) -}) - test_that("duckdb raises error for empty projection", { skip_if_not(has_duckdb_with_substrait()) tbl <- tibble::tibble(col = c(1, 2, NA)) @@ -244,7 +231,7 @@ test_that("duckdb raises error for empty projection", { expect_error( tbl %>% duckdb_substrait_compiler() %>% - substrait_project(), + substrait_select(), "Column list must not be empty" ) }) diff --git a/tests/testthat/test-project-rel.R b/tests/testthat/test-project-rel.R index 7d5c84c9..259385dd 100644 --- a/tests/testthat/test-project-rel.R +++ b/tests/testthat/test-project-rel.R @@ -1,13 +1,14 @@ -test_that("substrait_project() can select all columns unchanged", { +test_that("substrait_select() can select all columns unchanged", { tbl <- data.frame(col1 = 1, col2 = "one") compiler <- substrait_compiler(tbl) - result <- substrait_project(compiler, col1, col2) + result <- substrait_select(compiler, col1, col2) expect_s3_class(result, "SubstraitCompiler") # check that we did append a ProjectRel + expect_s3_class(result$rel$project, "substrait_ProjectRel") expect_identical( result$rel$project$input, compiler$rel @@ -18,6 +19,48 @@ test_that("substrait_project() can select all columns unchanged", { expect_identical(result$mask, compiler$mask) }) +test_that("substrait_project() can add zero columns", { + tbl <- data.frame(col1 = 1, col2 = "one") + compiler <- substrait_compiler(tbl) + + result <- substrait_project(compiler) + + # check that we did append a ProjectRel + expect_s3_class(result$rel$project, "substrait_ProjectRel") + + # make sure we didn't include an Emit clause + expect_null(result$rel$project$common$emit) + + # check that nothing else about the compiler changed + expect_identical(result$schema, compiler$schema) + expect_identical(result$mask, compiler$mask) +}) + +test_that("substrait_project() can add columns without an emit clause", { + tbl <- data.frame(col1 = 1, col2 = "one") + compiler <- substrait_compiler(tbl) + + result <- substrait_project(compiler, col3 = 3L) + + # check that we did append a ProjectRel + expect_s3_class(result$rel$project, "substrait_ProjectRel") + + # make sure we didn't include an unnecessary Emit clause + expect_null(result$rel$project$common$emit) + + # make sure we actually added a column + expect_identical(result$schema$names, c("col1", "col2", "col3")) + expect_identical(names(result$mask), c("col1", "col2", "col3")) + expect_identical( + result$schema$struct_$types, + list( + substrait_fp64(), + substrait_string(), + substrait_i32() + ) + ) +}) + test_that("simple_integer_field_reference() returns the correct structure", { object <- simple_integer_field_reference(32) expect_identical( @@ -26,8 +69,8 @@ test_that("simple_integer_field_reference() returns the correct structure", { ) }) -test_that("substrait_project() resets the mask and schema after evaluation", { - projected <- substrait_project( +test_that("substrait_select() resets the mask and schema after evaluation", { + projected <- substrait_select( data.frame(a = 1, b = 2L), b ) @@ -44,8 +87,8 @@ test_that("substrait_project() resets the mask and schema after evaluation", { ) }) -test_that("substrait_project() evaluates arguments in order", { - projected <- substrait_project( +test_that("substrait_select() evaluates arguments in order", { + projected <- substrait_select( data.frame(a = 1), b = a, c = b