Skip to content

Commit

Permalink
Delete ZetaSQL and clean repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Matts966 committed Jul 14, 2020
1 parent cc6b11f commit 2dcbfbd
Show file tree
Hide file tree
Showing 735 changed files with 272 additions and 389,819 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt update && sudo apt install bazel-1.0.0
bazel test --test_output=errors //zetasql/...
bazel test --test_output=errors //alphasql/...
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

24 changes: 0 additions & 24 deletions BUILD

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ build:
push: build
docker push matts966/alphasql:latest
osx:
CC=g++ bazel build //zetasql/experimental:all
sudo cp ./bazel-bin/zetasql/experimental/dag ./bin/osx/dag
sudo cp ./bazel-bin/zetasql/experimental/pipeline_type_checker ./bin/osx/pipeline_type_checker
CC=g++ bazel build //alphasql:all
sudo cp ./bazel-bin/alphasql/dag ./bin/osx/dag
sudo cp ./bazel-bin/alphasql/pipeline_type_checker ./bin/osx/pipeline_type_checker
sudo cp ./bin/osx/dag /usr/local/bin
sudo cp ./bin/osx/pipeline_type_checker /usr/local/bin
sample:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

[![github-action](https://github.com/Matts966/alphasql/workflows/release/badge.svg)](https://github.com/Matts966/alphasql/actions)

This repository is forked from [google/zetasql](https://github.com/google/zetasql) and provides integrated Type/Scheme Checker and Parallelization for sets of SQL files.

AlphaSQL eliminates syntax, type and schema errors from your datawarehouse.
AlphaSQL provides **Automatic Parallelization** for sets of SQL files and integrated **Type/Scheme Checker** to eliminate syntax, type and schema errors from your datawarehouse.

## Features

Expand Down
41 changes: 19 additions & 22 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2018 ZetaSQL Authors
# Copyright 2020 Matts966
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,25 +14,24 @@
# limitations under the License.
#

""" Workspace for Open Source ZetaSQL library """

workspace(name = "com_google_zetasql")

# Bazel doesn't support recursively loading dependencies.
# The recommended pattern is for a repo to provide a 'my_repo_deps()' method
# which will download all dependencies. Thus, a _direct dependency of 'my_repo'
# can ask it to load it dependencies. However, if 'my_repo' has dependencies
# which themselves have dependencies, and provide a 'child_repo_deps()',
# there is no way to compose a workspace such that 'my_repo_deps' calls
# 'child_repo_deps' (since this would represent a serialization of
# load-then-statement, which is forbidden). So, we take the tactic of providing
# a serialized sequence of numbered steps that must be invoked in series to
# load all dependencies. Copy the following code exactly into your WORKSPACE
# to fully download all dependencies. The exactly nature of what happens at
# each step may change over time (and additional steps may be added in the
# future).

# such that 'my_repo_deps'
""" Workspace for AlphaSQL """

workspace(name = "com_github_Matts966_alphasql")

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

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

http_archive(
name = "com_google_zetasql",
strip_prefix = "zetasql-2020.06.1",
urls = [
"https://github.com/google/zetasql/archive/2020.06.1.tar.gz",
],
sha256 = "fb82060f525177117181dfad1a629d1dc13f76dd5779e5a393d6405fb627100c",
patches = ["@com_github_Matts966_alphasql//bazel:zetasql.patch"],
)

load("@com_google_zetasql//bazel:zetasql_deps_step_1.bzl", "zetasql_deps_step_1")

zetasql_deps_step_1()
Expand All @@ -49,8 +48,6 @@ load("@com_google_zetasql//bazel:zetasql_deps_step_4.bzl", "zetasql_deps_step_4"

zetasql_deps_step_4()

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "com_github_nelhage_rules_boost",
commit = "9f9fb8b2f0213989247c9d5c0e814a8451d18d7f",
Expand Down
93 changes: 93 additions & 0 deletions alphasql/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# Copyright 2020 Matts966
#
# 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.
#

package(
default_visibility = ["//:__subpackages__"],
)

cc_library(
name = "json_schema_reader",
hdrs = ["json_schema_reader.h"],
deps = [
"@com_google_zetasql//zetasql/public:simple_catalog",
"@com_google_zetasql//zetasql/public:type",
"@boost//:property_tree",
"@com_google_absl//absl/strings",
],
)

cc_library(
name = "identifier_resolver",
hdrs = ["identifier_resolver.h"],
deps = [
"@com_google_zetasql//zetasql/public:simple_catalog",
"@com_google_zetasql//zetasql/public:type",
"@boost//:property_tree",
"@com_google_absl//absl/strings",
],
)

cc_binary(
name = "pipeline_type_checker",
srcs = [
"pipeline_type_checker.cc",
],
deps = [
":json_schema_reader",
"@com_google_zetasql//zetasql/base",
"@com_google_zetasql//zetasql/base:map_util",
"@com_google_zetasql//zetasql/base:ret_check",
"@com_google_zetasql//zetasql/base:source_location",
"@com_google_zetasql//zetasql/base:status",
"@com_google_zetasql//zetasql/base:statusor",
"@com_google_zetasql//zetasql/public:analyzer",
"@com_google_zetasql//zetasql/public:catalog",
"@com_google_zetasql//zetasql/public:evaluator",
"@com_google_zetasql//zetasql/public:evaluator_table_iterator",
"@com_google_zetasql//zetasql/public:language_options",
"@com_google_zetasql//zetasql/public:simple_catalog",
"@com_google_zetasql//zetasql/public:type",
"@com_google_zetasql//zetasql/public:type_cc_proto",
"@com_google_zetasql//zetasql/public:value",
"@com_google_zetasql//zetasql/resolved_ast",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:cord",
"@com_google_absl//absl/types:optional",
"@com_google_absl//absl/types:span",
"@com_google_protobuf//:protobuf",
"@boost//:graph",
],
)

cc_binary(
name = "dag",
srcs = [
"dag.cc",
],
deps = [
"@com_google_zetasql//zetasql/analyzer",
"@com_google_zetasql//zetasql/resolved_ast",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
"@com_google_absl//absl/strings",
"@boost//:graph",
":identifier_resolver",
],
)
13 changes: 8 additions & 5 deletions zetasql/experimental/dag.cc → alphasql/dag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "zetasql/base/status.h"
#include "zetasql/base/statusor.h"
#include "zetasql/public/analyzer.h"
#include "zetasql/analyzer/identifier_resolver.h"
#include "alphasql/identifier_resolver.h"
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
#include "boost/graph/graphviz.hpp"
Expand All @@ -40,7 +40,10 @@ struct table_queries {
std::vector<std::string> others;
};

namespace zetasql {
namespace alphasql {

using namespace zetasql;

// Returns <options> if it already has all arenas initialized, or otherwise
// populates <copy> as a copy for <options>, creates arenas in <copy> and
// returns it. This avoids unnecessary duplication of AnalyzerOptions, which
Expand Down Expand Up @@ -151,7 +154,7 @@ int main(int argc, char* argv[]) {
for (const auto& path : remaining_args) {
if (std::filesystem::is_regular_file(path)) {
std::filesystem::path file_path(path);
absl::Status status = zetasql::UpdateTableQueriesMapAndVertices(file_path, table_queries_map, vertices);
absl::Status status = alphasql::UpdateTableQueriesMapAndVertices(file_path, table_queries_map, vertices);
if (!status.ok()) {
std::cout << status << std::endl;
return 1;
Expand All @@ -165,7 +168,7 @@ int main(int argc, char* argv[]) {
if (err) {
std::cout << "WARNING: " << err << std::endl;
}
absl::Status status = zetasql::UpdateTableQueriesMapAndVertices(file_path->path(), table_queries_map, vertices);
absl::Status status = alphasql::UpdateTableQueriesMapAndVertices(file_path->path(), table_queries_map, vertices);
if (!status.ok()) {
std::cout << status << std::endl;
return 1;
Expand All @@ -176,7 +179,7 @@ int main(int argc, char* argv[]) {
std::vector<Edge> depends_on;
std::vector<std::string> external_required_tables;
for (auto const& [table_name, table_queries] : table_queries_map) {
zetasql::UpdateEdges(depends_on, table_queries.others, {
alphasql::UpdateEdges(depends_on, table_queries.others, {
table_queries.create,
});
if (table_queries.create.empty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ absl::Status FindTableNamesInScript(absl::string_view sql,
/*catalog=*/nullptr, table_names,
/*table_resolution_time_info_map=*/nullptr)
.FindTableNames(script);

}

} // namespace table_name_resolver
Expand Down
File renamed without changes.
Loading

0 comments on commit 2dcbfbd

Please sign in to comment.