Skip to content

Commit

Permalink
Export of internal ZetaSQL changes.
Browse files Browse the repository at this point in the history
--
Change by ZetaSQL Team <[email protected]>:
Update the resolved ast doc for ZetaSQL.
--
Change by Brandon Dolphin <[email protected]>:
Refactor out shared AddMeasureColumnsToTable function for working with measure columns.
--
Change by Christoph Dibak <[email protected]>:
Implement per-aggregation budgeting in the reference impl
--
Change by Nevena Kotlaja <[email protected]>:
No public description
--
Change by Nevena Kotlaja <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Implement method TimestampPicoValue::FromString().
--
Change by ZetaSQL Team <[email protected]>:
Fix standalone expression evaluation for multi-level aggregates.
--
Change by ZetaSQL Team <[email protected]>:
Add documentation for graph query syntax
--
Change by ZetaSQL Team <[email protected]>:
Fix a bug where information from `ExprResolutionInfo` is not propagated correctly up to parent `ExprResolutionInfos` for multi-level aggregation.
--
Change by ZetaSQL Team <[email protected]>:
Add SQL rewriter and missing analyzer tests for map_contains_key.
--
Change by Brandon Dolphin <[email protected]>:
Add deserialization for MeasureType.
--
Change by ZetaSQL Team <[email protected]>:
Add the parser implementation for pipe recursive union.
--
Change by ZetaSQL Team <[email protected]>:
Refactor ResolveMatchRecognize() into smaller methods.
--
Change by ZetaSQL Team <[email protected]>:
Add a RET_CHECK to ensure that PIVOT expressions in the reference implementation are not multi-level aggregations.
--
Change by ZetaSQL Team <[email protected]>:
Ensure that volatile grouping expressions are not considered grouping consts.
--
Change by ZetaSQL Team <[email protected]>:
Rename ResolvedMatchRecognizeEmptyPattern to ResolvedMatchRecognizePatternEmpty to have a consistent prefix with other nodes.
--
Change by Brandon Dolphin <[email protected]>:
Remove documented requirement for FEATURE_V_1_4_MULTILEVEL_AGGREGATION when analyzing measure expressions.
--
Change by ZetaSQL Team <[email protected]>:
Add more compliance tests for multi-level aggregation.
--
Change by ZetaSQL Team <[email protected]>:
Move the OPTIONS() list to the end of the MATCH_RECOGNIZE() syntax.
--
Change by ZetaSQL Team <[email protected]>:
Add a new option to AnalyzerOptions and ErrorMessageOptions to enable an enhanced form of error redaction which preserves some information about the error, while keeping the output stable.
--
Change by ZetaSQL Team <[email protected]>:
Coerce the predicate expression in MATCH_RECOGNIZE's DEFINE clause to BOOL before giving an error.
--
Change by ZetaSQL Team <[email protected]>:
Update the resolved ast documentation for the ZetaSQL release in Q4 2024.
--
Change by ZetaSQL Team <[email protected]>:
Add set operators to pipe syntax: UNION, INTERSECT, EXCEPT, CORRESPONDING
--
Change by Yassin Ezbakhe <[email protected]>:
`MatcherCollection`: Add `AddMatcher` method.
--
Change by Jeff Shute <[email protected]>:
Implement experimental terminal pipe operator for EXPORT DATA.
--
Change by Brandon Dolphin <[email protected]>:
Fix casing in table name extraction for `TABLE x` and `FROM x` referring to TVF args.
--
Change by ZetaSQL Team <[email protected]>:
Support pattern variable references in MATCH_RECOGNIZE's measures clause.
--
Change by ZetaSQL Team <[email protected]>:
Add SQL rewriter for map_get function.
--
Change by Brandon Dolphin <[email protected]>:
Update error message in JSON literal test.
--
Change by ZetaSQL Team <[email protected]>:
small changes
--
Change by ZetaSQL Team <[email protected]>:
Update COUNT and COUNTIF documentation.
--
Change by Brandon Dolphin <[email protected]>:
Fix typo in measure_expression target names.
--
Change by Brandon Dolphin <[email protected]>:
Add Java implementation of MeasureType.
--
Change by ZetaSQL Team <[email protected]>:
Add support for graph queries
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
internal
--
Change by ZetaSQL Team <[email protected]>:
Add MATCH_RECOGNIZE compliance test covering the scenario where a DEFINE expression evaluates to NULL rather than TRUE or FALSE.
--
Change by ZetaSQL Team <[email protected]>:
Remove unimplemented optimization-related items from the pattern matching api:
--
Change by Brandon Dolphin <[email protected]>:
Implement MeasureType::TypeNameWithModifiers.
--
Change by Brandon Dolphin <[email protected]>:
Fix typo in sql_test_base.cc variable name.
--
Change by ZetaSQL Team <[email protected]>:
Add ZetaSketch to the list of external applications that can be used to build sketches.
--
Change by ZetaSQL Team <[email protected]>:
Add anonymization threshold to the AnonymizationInfo class
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Fix struct construction syntax in examples of sparse vectors.
--
Change by Jeff Shute <[email protected]>:
Initial resolved AST and analyzer for pipe FORK.
--
Change by ZetaSQL Team <[email protected]>:
Internal fix.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Add INTERVAL to JSON encoding documentation.
--
Change by ZetaSQL Team <[email protected]>:
Internal changes.
--
Change by ZetaSQL Team <[email protected]>:
Validate composite measure.
--
Change by Brandon Dolphin <[email protected]>:
Add deprecation warning for `TABLE x` syntax cases which will be affected by resolution order change.
--
Change by ZetaSQL Team <[email protected]>:
Add SQL rewriter for MAP_CARDINALITY
--
Change by Brandon Dolphin <[email protected]>:
Add feature `FEATURE_TABLE_SYNTAX_RESOLVE_ARGUMENT_LAST` to preserve the old (incorrect) resolution order for `TABLE x` syntax in SQL TVF bodies.
--
Change by ZetaSQL Team <[email protected]>:
Analyzer support for ON CONFLICT clause in INSERT DML
--
Change by ZetaSQL Team <[email protected]>:
Fix a bug in the script executor where redeclaring a variable without type parameters in a session would cause an error
--
Change by Lev Kandel <[email protected]>:
Prepare code for breaking change in Protobuf C++ API.
Protobuf 6.30.0 will change the return types of Descriptor::name() and other methods to absl::string_view. This makes the code work both before and after such a change.
--
Change by ZetaSQL Team <[email protected]>:
Fix an incorrect comment.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Change complexity limit for state machine algo from 15,000 states to 100,000 edges, as it's the number of edges, not states, that really determines the time and space requirements of the algorithm. Also, moved the check from NFABuilder into NFA itself so that it gets enforced inside of EpsilonRemover, which, in the worst case, can drastically increase the number of edges, while simultaneously reducing the number of states.
--
Change by Jeff Shute <[email protected]>:
Add some support for referencing Constants with values.
--
Change by ZetaSQL Team <[email protected]>:
Unify the creation of multi_level_aggregate_info QRI for all the paths that create a default.
--
Change by John Fremlin <[email protected]>:
Add RowIdentityColumns function to catalog Table
--
Change by ZetaSQL Team <[email protected]>:
Remove references to Bison from comments in gen_parse_tree.py.
--
Change by ZetaSQL Team <[email protected]>:
Remove "Bison" from the names of some functions and variables in keywords.h.
--
Change by ZetaSQL Team <[email protected]>:
Enable SELECT .. FOR UPDATE for external use.
--
Change by ZetaSQL Team <[email protected]>:
Fix the order of parameters in the Regexp::Extract function.
--
Change by ZetaSQL Team <[email protected]>:
Add support for UINT64 arguments to `TIMESTAMP_FROM_UNIX_SECONDS`, `TIMESTAMP_FROM_UNIX_MILLIS`, and `TIMESTAMP_FROM_UNIX_MICROS`.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Enable multi-level aggregation in RQG.
--
Change by ZetaSQL Team <[email protected]>:
Fix a bug with deferred resolution for multi-level aggregates.
--
Change by ZetaSQL Team <[email protected]>:
Fix some formatting issues with ST_EQUALS.
--
Change by ZetaSQL Team <[email protected]>:
Remove "pipe operator" from pipe operator table to economize.
--
Change by Laramie Leavitt <[email protected]>:
Avoid creating a new PRNG on each test loop.
--
Change by Jeff Shute <[email protected]>:
Parser implementation for experimental pipe FORK.
--
Change by ZetaSQL Team <[email protected]>:
Internal Change
  (And 482 more changes)

GitOrigin-RevId: 158e00ddbc5bb8b8ef75e6b6473daf4fcef6174a
Change-Id: I6520749d9676a3fce2e84a49f3e1dd6804390ab7
  • Loading branch information
ZetaSQL Team authored and KimiWaRokkuWoKikanai committed Nov 12, 2024
1 parent 194cd32 commit a516c6b
Show file tree
Hide file tree
Showing 711 changed files with 196,848 additions and 17,044 deletions.
9 changes: 6 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# suppression you can invoke with --config=clang
build:clang --action_env=BAZEL_CXXOPTS="-std=c++17"
build:clang --cxxopt=-std=c++17
build:clang --cxxopt=-Wno-module-import-in-extern-c
build:clang --cxxopt=-Wno-deprecated-declarations
build:clang --cxxopt=-Wno-range-loop-analysis
build:clang --cxxopt=-Wno-inconsistent-missing-override
Expand Down Expand Up @@ -54,6 +55,8 @@ build:g++ --cxxopt=-Wno-stringop-truncation

# C++17 is required to build ZetaSQL, hence `-cxxopt=-std=c++17`. On MacOS
# `--host_cxxopt=-std=c++17` is also needed.
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
run --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
# "--enable_bzlmod=false" is required because grpc does not support bzlmod yet.
# "--java_runtime_version=remotejdk_11": to make the build more hermetic.
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=clang --enable_bzlmod=false --java_runtime_version=remotejdk_11
run --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=clang --enable_bzlmod=false --java_runtime_version=remotejdk_11
test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=clang --enable_bzlmod=false --java_runtime_version=remotejdk_11
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.2.1
29 changes: 12 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,24 @@ FROM ubuntu:18.04 as build
RUN apt-get update && apt-get -qq install -y default-jre default-jdk

# Install prerequisites for bazel
RUN apt-get update && apt-get -qq install curl tar build-essential wget \
python python3 zip unzip

ENV BAZEL_VERSION=6.5.0

# Install bazel from source
RUN mkdir -p bazel && \
cd bazel && \
wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip &&\
unzip bazel-${BAZEL_VERSION}-dist.zip && \
rm -rf bazel-${BAZEL_VERSION}-dist.zip
ENV PATH=$PATH:/usr/bin:/usr/local/bin
ENV EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk"
RUN cd bazel && bash ./compile.sh
RUN cp /bazel/output/bazel /usr/local/bin
RUN apt-get -qq install curl tar build-essential wget python python3 zip unzip

ENV BAZEL_VERSION=7.2.1

RUN apt install apt-transport-https curl gnupg -y
RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
RUN mv bazel-archive-keyring.gpg /usr/share/keyrings
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list

RUN apt update && apt -qq install -y bazel-${BAZEL_VERSION}
RUN ln -s /usr/bin/bazel-${BAZEL_VERSION} /usr/bin/bazel

RUN apt-get update && DEBIAN_FRONTEND="noninteractive" \
TZ="America/Los_Angeles" apt-get install -y tzdata

# Unfortunately ZetaSQL has issues with clang (default bazel compiler), so
# we install GCC. Also install make for rules_foreign_cc bazel rules.
RUN apt-get -qq install -y software-properties-common make rename git ca-certificates libgnutls30
RUN apt-get -qq install -y software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get -qq update && \
Expand All @@ -50,8 +47,6 @@ RUN useradd -ms /bin/bash zetasql
RUN chown -R zetasql:zetasql /zetasql
USER zetasql

ENV BAZEL_ARGS="--config=g++"

ENV HOME=/home/zetasql
RUN mkdir -p $HOME/bin

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ZetaSQL is not itself a database or query engine. Instead,
it's intended to be used by multiple engines, to provide consistent
language and behavior (name resolution, type checking, implicit
casting, etc.). Specific query engines may implement a subset of features,
giving errors for unuspported features.
giving errors for unsupported features.
ZetaSQL's compliance test suite can be used to validate query engine
implementations are correct and consistent.

Expand Down
14 changes: 11 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ workspace(name = "com_google_zetasql")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "toolchains_llvm",
canonical_id = "1.0.0",
sha256 = "e91c4361f99011a54814e1afbe5c436e0d329871146a3cd58c23a2b4afb50737",
strip_prefix = "toolchains_llvm-1.0.0",
url = "https://github.com/bazel-contrib/toolchains_llvm/releases/download/1.0.0/toolchains_llvm-1.0.0.tar.gz",
)

http_archive(
name = "rules_jvm_external",
sha256 = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6",
Expand All @@ -47,9 +55,9 @@ http_archive(
# gRPC Java
http_archive(
name = "io_grpc_grpc_java",
url = "https://github.com/grpc/grpc-java/archive/v1.56.0.tar.gz",
strip_prefix = "grpc-java-1.56.0",
sha256 = "4af5ecbaed16455fcda9fdab36e131696f5092858dd130f026069fcf11817a21",
sha256 = "301e0de87c7659cc790bd2a7265970a71632d55773128c98768385091c0a1a97",
strip_prefix = "grpc-java-1.61.0",
url = "https://github.com/grpc/grpc-java/archive/v1.61.0.zip",
)

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
Expand Down
10 changes: 10 additions & 0 deletions bazel/grpc_cf_engine.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- src/core/BUILD
+++ src/core/BUILD
@@ -2563,6 +2563,7 @@
external_deps = [
"absl/container:flat_hash_map",
"absl/log:check",
+ "absl/status",
"absl/strings",
"absl/strings:str_format",
],
2 changes: 1 addition & 1 deletion bazel/grpc_extra_deps.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 4d8afa3131..b42224501f 100644
api_dependencies()

- go_rules_dependencies()
- go_register_toolchains(version = "1.18")
- go_register_toolchains(version = "1.20")
- gazelle_dependencies()
-
# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is
Expand Down
23 changes: 13 additions & 10 deletions bazel/icu.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ filegroup(
configure_make(
name = "icu",
configure_command = "source/configure",
env = select({
"@platforms//os:macos": {
"AR": "",
"CXXFLAGS": "-fPIC", # For JNI
"CFLAGS": "-fPIC", # For JNI
},
"//conditions:default": {
"CXXFLAGS": "-fPIC", # For JNI
"CFLAGS": "-fPIC", # For JNI
},
args = select({
# AR is overridden to be libtool by rules_foreign_cc. It does not support ar style arguments
# like "r". We need to prevent the icu make rules from adding unsupported parameters by
# forcing ARFLAGS to keep the rules_foreign_cc value in this parameter
"@platforms//os:macos": [
"ARFLAGS=\"-static -o\"",
"MAKE=gnumake",
],
"//conditions:default": [],
}),
env = {
"CXXFLAGS": "-fPIC", # For JNI
"CFLAGS": "-fPIC", # For JNI
},
configure_options = [
"--enable-option-checking",
"--enable-static",
Expand Down
2 changes: 1 addition & 1 deletion bazel/icu4c-64_2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CXX = @CXX@
AR = @AR@
-ARFLAGS = @ARFLAGS@ r
+ARFLAGS = @ARFLAGS@
+ARFLAGS = @ARFLAGS@ -crs
RANLIB = @RANLIB@
COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
Expand Down
Loading

0 comments on commit a516c6b

Please sign in to comment.