Skip to content

Commit

Permalink
Fix options
Browse files Browse the repository at this point in the history
  • Loading branch information
Matts966 committed Jun 6, 2021
1 parent 4273ea9 commit 910c2c9
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# c++1z was used prior to c++17 being standardized, and is therefore more
# widely accepted by compilers. This may lead to strange behavior or compiler
# errors in earlier compilers.
build --cxxopt="-std=c++1z"
build --cxxopt="-std=c++1z" --features=-supports_dynamic_linker
5 changes: 4 additions & 1 deletion alphasql/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ cc_library(
"@com_google_zetasql//zetasql/public:simple_catalog",
"@com_google_zetasql//zetasql/public:type",
"@com_google_zetasql//zetasql/public:analyzer",
"@com_google_zetasql//zetasql/analyzer:analyzer_impl",
"@com_google_zetasql//zetasql/analyzer:resolver",
"@com_google_zetasql//zetasql/public:language_options",
"@com_google_zetasql//zetasql/parser:parser",
"@boost//:property_tree",
Expand Down Expand Up @@ -70,6 +72,7 @@ cc_binary(
"@com_google_zetasql//zetasql/base:status",
"@com_google_zetasql//zetasql/base:statusor",
"@com_google_zetasql//zetasql/public:analyzer",
"@com_google_zetasql//zetasql/analyzer:analyzer_impl",
"@com_google_zetasql//zetasql/public:catalog",
"@com_google_zetasql//zetasql/public:evaluator",
"@com_google_zetasql//zetasql/public:evaluator_table_iterator",
Expand Down Expand Up @@ -105,7 +108,7 @@ cc_library(
name = "dag_lib",
hdrs = ["dag_lib.h"],
deps = [
"@com_google_zetasql//zetasql/public:analyzer",
"@com_google_zetasql//zetasql/analyzer:analyzer_impl",
"@com_google_zetasql//zetasql/resolved_ast",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
Expand Down
49 changes: 45 additions & 4 deletions bazel/zetasql.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,67 @@
diff --git zetasql/analyzer/BUILD zetasql/analyzer/BUILD
index 91c73c6..57e5609 100644
--- zetasql/analyzer/BUILD
+++ zetasql/analyzer/BUILD
@@ -18,7 +18,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(":builddefs.bzl", "gen_analyzer_test")

package(
- default_visibility = ["//zetasql/base:zetasql_implementation"],
+ default_visibility = ["//visibility:public"],
)

filegroup(
diff --git zetasql/base/BUILD zetasql/base/BUILD
index 75c8e3e..7874e07 100644
--- zetasql/base/BUILD
+++ zetasql/base/BUILD
@@ -17,7 +17,7 @@
licenses(["notice"]) # Apache v2.0

package(
- default_visibility = [":zetasql_implementation"],
+ default_visibility = ["//visibility:public"],
)

package_group(
diff --git zetasql/parser/BUILD zetasql/parser/BUILD
index 5c3c636..5404163 100644
--- zetasql/parser/BUILD
+++ zetasql/parser/BUILD
@@ -20,7 +20,7 @@ load("//bazel:bison.bzl", "genyacc")
load("//bazel:flex.bzl", "genlex")

package(
- default_visibility = ["//zetasql/base:zetasql_implementation"],
+ default_visibility = ["//visibility:public"],
)

genrule(

--- zetasql/public/simple_catalog.h
+++ zetasql/public/simple_catalog.h
@@ -55,6 +55,11 @@ class SimpleTableProto;
//
// This class is thread-safe.
class SimpleCatalog : public EnumerableCatalog {
+ friend void dropOwnedTable(SimpleCatalog* catalog, const std::string& name);
+ friend void dropOwnedTableIfExists(SimpleCatalog* catalog, const std::string& name);
+ friend void dropOwnedFunction(SimpleCatalog* catalog, const std::string& full_name_without_group);
+
+
public:
// Construct a Catalog with catalog name <name>.
//

diff --git zetasql/public/sql_formatter.cc zetasql/public/sql_formatter.cc
index 26e52ed..28e8928 100644
--- zetasql/public/sql_formatter.cc
+++ zetasql/public/sql_formatter.cc
@@ -72,6 +72,7 @@ absl::Status FormatSql(const std::string& sql, std::string* formatted_sql) {
std::vector<ParseToken> parse_tokens;
ParseTokenOptions options;
options.stop_at_end_of_statement = true;
+ options.include_comments = true;
const int statement_start = location.byte_position();
const absl::Status token_status =
GetParseTokens(options, &location, &parse_tokens);
2 changes: 1 addition & 1 deletion samples/sample-ci/alphacheck_stdout.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql"
ERROR: INVALID_ARGUMENT: Table not found: `bigquery-public-data.samples.gsod` [at samples/sample-ci/sample/create_datawarehouse3.sql:5:3]
catalog:
dataset.main
tablename2
dataset.main
tablename1

0 comments on commit 910c2c9

Please sign in to comment.