Skip to content

Commit 041fecb

Browse files
authored
Merge pull request #2 from chaojun-zhang/main_backup
Initial commit of substrait-cpp
2 parents 548d653 + 8e60d95 commit 041fecb

33 files changed

+2725
-201
lines changed

.clang-format

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeBraces: Attach
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializersBeforeComma: false
36+
BreakAfterJavaFieldAnnotations: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 80
39+
CommentPragmas: '^ IWYU pragma:'
40+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
41+
ConstructorInitializerIndentWidth: 4
42+
ContinuationIndentWidth: 4
43+
Cpp11BracedListStyle: true
44+
DerivePointerAlignment: false
45+
DisableFormat: false
46+
ForEachMacros: [ FOR_EACH, FOR_EACH_R, FOR_EACH_RANGE, ]
47+
IncludeCategories:
48+
- Regex: '^<.*\.h(pp)?>'
49+
Priority: 1
50+
- Regex: '^<.*'
51+
Priority: 2
52+
- Regex: '.*'
53+
Priority: 3
54+
IndentCaseLabels: true
55+
IndentWidth: 2
56+
IndentWrappedFunctionNames: false
57+
KeepEmptyLinesAtTheStartOfBlocks: false
58+
MacroBlockBegin: ''
59+
MacroBlockEnd: ''
60+
MaxEmptyLinesToKeep: 1
61+
NamespaceIndentation: None
62+
ObjCBlockIndentWidth: 2
63+
ObjCSpaceAfterProperty: false
64+
ObjCSpaceBeforeProtocolList: false
65+
PenaltyBreakBeforeFirstCallParameter: 1
66+
PenaltyBreakComment: 300
67+
PenaltyBreakFirstLessLess: 120
68+
PenaltyBreakString: 1000
69+
PenaltyExcessCharacter: 1000000
70+
PenaltyReturnTypeOnItsOwnLine: 200
71+
PointerAlignment: Left
72+
ReflowComments: true
73+
SortIncludes: true
74+
SpaceAfterCStyleCast: false
75+
SpaceBeforeAssignmentOperators: true
76+
SpaceBeforeParens: ControlStatements
77+
SpaceInEmptyParentheses: false
78+
SpacesBeforeTrailingComments: 1
79+
SpacesInAngles: false
80+
SpacesInContainerLiterals: true
81+
SpacesInCStyleCastParentheses: false
82+
SpacesInParentheses: false
83+
SpacesInSquareBrackets: false
84+
Standard: Cpp11
85+
TabWidth: 8
86+
UseTab: Never
87+
...

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
src/proto/substrait

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "third_party/yaml-cpp"]
2+
path = third_party/yaml-cpp
3+
url = https://github.com/jbeder/yaml-cpp.git
4+
[submodule "third_party/googletest"]
5+
path = third_party/googletest
6+
url = https://github.com/google/googletest.git
7+
[submodule "third_party/substrait"]
8+
path = third_party/substrait
9+
url = https://github.com/substrait-io/substrait.git
10+
[submodule "third_party/fmt"]
11+
path = third_party/fmt
12+
url = https://github.com/fmtlib/fmt

CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.10)
4+
5+
# set the project name
6+
project(substrait-cpp)
7+
8+
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
9+
10+
set(CMAKE_CXX_STANDARD 17)
11+
set(CMAKE_CXX_STANDARD_REQUIRED True)
12+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13+
14+
option(
15+
BUILD_TESTING
16+
"Enable substrait-cpp tests. This will enable all other build options automatically."
17+
ON)
18+
19+
find_package(Protobuf REQUIRED)
20+
include_directories(${PROTOBUF_INCLUDE_DIRS})
21+
22+
add_subdirectory(third_party)
23+
include_directories(include)
24+
add_subdirectory(substrait)

LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
.PHONY: all clean build debug release
4+
5+
BUILD_TYPE := Release
6+
7+
all: debug
8+
9+
clean:
10+
@rm -rf build-*
11+
12+
build-common:
13+
@mkdir -p build-${BUILD_TYPE}
14+
@cd build-${BUILD_TYPE} && \
15+
cmake -Wno-dev \
16+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
17+
-DPREFER_STATIC_LIBS=OFF \
18+
$(FORCE_COLOR) \
19+
..
20+
21+
build:
22+
VERBOSE=1 cmake --build build-${BUILD_TYPE} -j $${CPU_COUNT:-`nproc`} || \
23+
cmake --build build-${BUILD_TYPE}
24+
25+
debug:
26+
@$(MAKE) build-common BUILD_TYPE=Debug
27+
@$(MAKE) build BUILD_TYPE=Debug
28+
29+
release:
30+
@$(MAKE) build-common BUILD_TYPE=Release
31+
@$(MAKE) build BUILD_TYPE=Release

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
# substrait-cpp
22

33
Planned home for CPP libraries to help build/consume Substrait query plans.
4+
5+
## Getting Started
6+
7+
We provide scripts to help developers setup and install substrait-cpp dependencies.
8+
9+
### Get the substrait-cpp Source
10+
```
11+
git clone --recursive https://github.com/substrait-io/substrait-cpp.git
12+
cd substrait-cpp
13+
# if you are updating an existing checkout
14+
git submodule sync --recursive
15+
git submodule update --init --recursive
16+
```
17+
18+
### Setting up on Linux (Ubuntu 20.04 or later)
19+
20+
Once you have checked out substrait-cpp, you can setup and build like so:
21+
22+
```shell
23+
$ ./scripts/setup-ubuntu.sh
24+
$ make
25+
```
26+
27+
## License
28+
29+
substrait-cpp is licensed under the Apache 2.0 License. A copy of the license
30+
[can be found here.](https://www.apache.org/licenses/LICENSE-2.0.html)

0 commit comments

Comments
 (0)