Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor code structure #2

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
723eb23
substrait yaml file parser and function lookup support
chaojun-zhang Oct 28, 2022
1add990
Update Cmakelist
chaojun-zhang Oct 29, 2022
59d955d
refactor code structure
Nov 6, 2022
a3cce71
Update README.md
chaojun-zhang Nov 8, 2022
cc3bf4f
Update README.md
chaojun-zhang Nov 8, 2022
f5e9d6f
Update include/substrait/common/Exceptions.h
chaojun-zhang Nov 8, 2022
ed29e44
Update substrait/common/Exceptions.cpp
chaojun-zhang Nov 8, 2022
a78a513
Update include/substrait/function/FunctionLookup.h
chaojun-zhang Nov 8, 2022
ae7299c
Update include/substrait/function/Extension.h
chaojun-zhang Nov 8, 2022
db6a202
fix issues
chaojun-zhang Nov 8, 2022
2568fc1
fix issues
chaojun-zhang Nov 8, 2022
70c7a31
rename functionVariant to functionImplementation
chaojun-zhang Nov 8, 2022
3c5acae
use spdx license header
chaojun-zhang Nov 8, 2022
893a974
fix issues
chaojun-zhang Nov 8, 2022
8e60d95
fix issues
chaojun-zhang Nov 27, 2022
041fecb
Merge pull request #2 from chaojun-zhang/main_backup
westonpace Dec 11, 2022
1404ebd
feat(docker): adding initial docker setup (wip)
vibhatha Dec 26, 2022
0885a8c
fix(library): added wget to dependencies in installation
vibhatha Dec 26, 2022
acb7c59
fix(build): adding fmt and cleanup docker image
vibhatha Dec 27, 2022
dfc1dd9
fix(cleanup): remove unnecessary newlines
vibhatha Dec 27, 2022
c8eb62b
Merge pull request #6 from vibhatha/minor-install
westonpace Dec 27, 2022
04f183e
fix(naming): Rename namespace 'substrait' to 'io::substrait'
chaojun-zhang Jan 3, 2023
cb8a023
Merge pull request #7 from vibhatha/feat-dockerfile
westonpace Jan 21, 2023
717bb01
fix: Rename namespace 'substrait' to 'io::substrait'
westonpace Jan 30, 2023
0a67c5b
fix(naming): rename variant to implementation
chaojun-zhang Dec 20, 2022
7a78b4f
Empty commit to trigger GHA checks
westonpace Feb 8, 2023
7c3b0e3
Apply suggestions from code review
westonpace Feb 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
AccessModifierOffset: -1
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ FOR_EACH, FOR_EACH_R, FOR_EACH_RANGE, ]
IncludeCategories:
- Regex: '^<.*\.h(pp)?>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
*.exe
*.out
*.app

src/proto/substrait
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "third_party/yaml-cpp"]
path = third_party/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "third_party/substrait"]
path = third_party/substrait
url = https://github.com/substrait-io/substrait.git
[submodule "third_party/fmt"]
path = third_party/fmt
url = https://github.com/fmtlib/fmt
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.10)

# set the project name
project(substrait-cpp)

message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(
BUILD_TESTING
"Enable substrait-cpp tests. This will enable all other build options automatically."
ON)

find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})

add_subdirectory(third_party)
include_directories(include)
add_subdirectory(substrait)
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-License-Identifier: Apache-2.0

.PHONY: all clean build debug release

BUILD_TYPE := Release

all: debug

clean:
@rm -rf build-*

build-common:
@mkdir -p build-${BUILD_TYPE}
@cd build-${BUILD_TYPE} && \
cmake -Wno-dev \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DPREFER_STATIC_LIBS=OFF \
$(FORCE_COLOR) \
..

build:
VERBOSE=1 cmake --build build-${BUILD_TYPE} -j $${CPU_COUNT:-`nproc`} || \
cmake --build build-${BUILD_TYPE}

debug:
@$(MAKE) build-common BUILD_TYPE=Debug
@$(MAKE) build BUILD_TYPE=Debug

release:
@$(MAKE) build-common BUILD_TYPE=Release
@$(MAKE) build BUILD_TYPE=Release
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# substrait-cpp

Planned home for CPP libraries to help build/consume Substrait query plans.

## Getting Started

We provide scripts to help developers setup and install substrait-cpp dependencies.

### Get the substrait-cpp Source
```
git clone --recursive https://github.com/substrait-io/substrait-cpp.git
cd substrait-cpp
# if you are updating an existing checkout
git submodule sync --recursive
git submodule update --init --recursive
```

### Setting up on Linux (Ubuntu 20.04 or later)

Once you have checked out substrait-cpp, you can setup and build like so:

```shell
$ ./scripts/setup-ubuntu.sh
$ make
```

## License

substrait-cpp is licensed under the Apache 2.0 License. A copy of the license
[can be found here.](https://www.apache.org/licenses/LICENSE-2.0.html)
Loading