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

Prism Query Interface: Replace gRPC with custom handling of messages #495

Merged
merged 2,407 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2407 commits
Select commit Hold shift + click to select a range
71476e3
More fixes for the merge
gartens Mar 19, 2024
3dbe949
INTEGER PRIMARY KEY
gartens Feb 15, 2024
fcadb61
Prevents problems when deserializing arrays
gartens Feb 15, 2024
71fb0c7
Do not aquire a lock for things like SELECT 1
gartens Feb 15, 2024
5c4b6d0
Remove superfluous annotation and turn around conditional
gartens Feb 15, 2024
63093ad
Better error messages
gartens Feb 15, 2024
db6624a
Various time improvements, some from the merge
gartens Feb 15, 2024
df51e29
Make gradle happier
gartens Feb 15, 2024
551febd
Connect, Disconnect, Commit and Rollback work again
gartens Feb 27, 2024
b758034
Python test pass again
gartens Feb 27, 2024
d516d9a
Remove client UUID
gartens Feb 27, 2024
60b23cd
Various lints and reduce red text in logs
gartens Feb 27, 2024
ba21844
Remove gRPC from dependencies
gartens Feb 28, 2024
0f60f8e
Use out for outputstream, not os
gartens Feb 28, 2024
23d2d60
Pass fetchSize to getNextBatch
gartens Feb 29, 2024
0f52f6d
Rework server loop to be somewhat async
gartens Mar 1, 2024
cc6b3f3
Add TEXT as ProtoPolyType to mirror the PolyType
gartens Mar 1, 2024
ced0da2
Remove unused exceptions from signature
gartens Mar 1, 2024
c7ce631
Add DbmsVersion related calls
gartens Mar 1, 2024
b5bbeb4
Add DbmsVersion related calls
gartens Mar 4, 2024
c8dc45d
More tests
gartens Mar 4, 2024
8c4ab2d
All but one call are now implemented, or there is a reason why not
gartens Mar 4, 2024
41603c9
Add executeIndexedStatementBatch
gartens Mar 4, 2024
c43cdf5
add documentation comments to proto files for automated documentation…
Mar 4, 2024
0e36fcc
update doc comment of ProtoValue
Mar 5, 2024
a9f424a
update doc comment of Entity
Mar 5, 2024
b6a54d1
Update log message
gartens Mar 7, 2024
3e704c2
Add helper to create error responses
gartens Mar 7, 2024
3562faa
Add Transport interface to abstract connections
gartens Mar 7, 2024
79089f0
Add names for threads and remove shutdown hook
gartens Mar 7, 2024
752cf92
Fix a typo and move Transports to their own directory
gartens Mar 8, 2024
bda39c1
fix connection accessor
Mar 11, 2024
752aa6b
fix syntax
Mar 11, 2024
36a392d
Switch to SocketChannels
gartens Mar 11, 2024
784e494
Better log message
gartens Mar 8, 2024
6e8d53f
Remove unused StreamObserver class
gartens Mar 8, 2024
ae28e34
Bump protobuf version
gartens Mar 8, 2024
0423f6b
Update JdbcConnectionTest.java to Jupiter
gartens Mar 8, 2024
fa5ae2f
Make field name consistent with other messages
gartens Mar 8, 2024
d214dd1
fix syntax
Mar 11, 2024
2f8bec4
fix syntax
Mar 11, 2024
451d306
fix syntax
Mar 11, 2024
ad8b88a
support statements of any language
Mar 11, 2024
0c89a0a
Use correct port for JDBC connections
gartens Mar 11, 2024
042bff0
Add primary key to test table
Mar 11, 2024
8b4f210
Add assertions for correct row counts
Mar 11, 2024
90b449d
Fix failing connection tests
Mar 11, 2024
0f8c498
Add primary key to test table
Mar 11, 2024
f4309a1
Add primary key to test table
Mar 11, 2024
0448687
Cleanup null deserialization
Mar 12, 2024
60051cb
Add integration tests for time, date and timestamp
Mar 12, 2024
843ee96
Add UnixTransport
gartens Mar 11, 2024
826af18
Experimental peer based authentication
gartens Mar 11, 2024
d4b311d
Do not complain about EOF
gartens Mar 11, 2024
3e36ab7
Print a line, not an entire stacktrace for IOExceptions
gartens Mar 12, 2024
a6fe836
Remove read lock
gartens Mar 12, 2024
460e174
Add a very ugly "event loop"
gartens Mar 12, 2024
098c3c4
Set Thread names
gartens Mar 13, 2024
b6a4975
Lowercase name before logging it
gartens Mar 13, 2024
294568b
Sync protobuf files
gartens Mar 13, 2024
41d7795
Add stopwatch reset
Mar 15, 2024
97d4e52
Fix array metadata
Mar 15, 2024
05234e5
Add result set closing between executions
Mar 15, 2024
74b5029
Debug failing tests
Mar 15, 2024
0b79336
Fix illegal casts
Mar 16, 2024
bf4c2f9
Fix meta only returning unique indexes
Mar 16, 2024
a4d33f9
Use GenericRuntimeExceptions
gartens Mar 14, 2024
2194ff0
Improve QueryInterfaceManager
gartens Mar 15, 2024
249b863
Improve error handling when interface creation fails
gartens Mar 15, 2024
aa9e15a
Honor the port which is configured
gartens Mar 15, 2024
d5112d0
Stricter visibility
gartens Mar 18, 2024
211aee6
One interface, one server
gartens Mar 18, 2024
03ef6d4
Remove exception that is never thrown from signature
gartens Mar 19, 2024
8e1f7fb
Update Protobuf files
gartens Mar 19, 2024
991e47b
Change how dates are serialized
gartens Mar 19, 2024
654e521
Remove unused imports
gartens Mar 19, 2024
d6056c3
Remove Graph and user defined values as they are currently not supported
gartens Mar 19, 2024
1cc73f9
Update Protobuf Files
gartens Mar 19, 2024
082fc1d
Reorder switch to match order everywhere else
gartens Mar 19, 2024
9de4610
Add qualifier to interval
gartens Mar 19, 2024
a8895e1
Change interval to only contain months or milliseconds
gartens Mar 20, 2024
da49cac
cleanup mql test
Mar 20, 2024
2faa637
Cleanup DdlTest
Mar 20, 2024
a8275e8
Adjust tests for new meta
Mar 20, 2024
fcd5c48
Add PolyMap deserialization
Mar 20, 2024
a0f38c9
Remove unused interval types
Mar 20, 2024
88a1ffb
Remove unused comments
Mar 20, 2024
8ee1125
Add request and response for closing result sets
Mar 20, 2024
05c223d
Update protobuf files
gartens Mar 20, 2024
bcd44f0
Fix typo
Mar 20, 2024
238bd54
Add manual result set closing
Mar 20, 2024
9bdf468
Turn around peer authentication
gartens Mar 22, 2024
7051567
Keep ProtoPolyType in sync with PolyType
gartens Mar 22, 2024
07008ea
Fix serialization tests
Mar 25, 2024
818fd83
clean up result closing
Mar 25, 2024
0b08ec4
Use a higher log level for unexpected errors
gartens Mar 27, 2024
b04db0f
Do not close connection on error
gartens Mar 27, 2024
9e86b70
Add unix listener in .polypheny folder
gartens Mar 27, 2024
e0f3375
Rename proto to prism
Mar 27, 2024
ce20d65
Add unix listener in .polypheny folder for all modes
gartens Mar 27, 2024
1a91cf5
Use a simple break instead of EOFException
gartens Mar 27, 2024
9b6e160
Better error messages in deserializeProtoValue
gartens Mar 28, 2024
b6b7294
Remove BigDecimal precision field
gartens Mar 28, 2024
98dd862
Remove unused import
gartens Apr 2, 2024
069db55
Fix transport delay
Apr 3, 2024
8c2a1ec
Add file types, clean up jdbc types
Apr 4, 2024
310a32d
Fix unix transport
gartens Apr 3, 2024
d63b288
Unbreak build
gartens Apr 4, 2024
daa2369
Specify timeout directly in workflows
gartens Apr 5, 2024
e169c6c
Make namespaceType final
gartens Apr 5, 2024
cc1f0fb
Build the driver in the workflow until it has been released
gartens Apr 5, 2024
0bde3f4
Add monitoring page
Apr 8, 2024
c62d791
Sync protofiles & update interval serialization
gartens Apr 9, 2024
2d2db46
Fix build
gartens Apr 9, 2024
627b49d
Sync protofiles
gartens Apr 9, 2024
7ead805
Rename unix socket
gartens Apr 9, 2024
3fa7758
Authenticate users as Catalog.USER_NAME if their peer name matches th…
gartens Apr 9, 2024
7436111
Check for null with isNull as well
gartens Apr 10, 2024
38d8e30
Remove debug class
gartens Apr 10, 2024
bc14ec8
Sync protofiles & remove heartbeat
gartens Apr 10, 2024
86dcdd9
Mark fields as final
gartens Apr 11, 2024
93d526d
Remove heartbeat leftovers
gartens Apr 11, 2024
efb80bb
Sync protofiles & replace DatabaseRequest
gartens Apr 11, 2024
c47f005
Centralize authentication assertion
gartens Apr 11, 2024
5528d1a
Restrict visibilities and other small fixes
gartens Apr 11, 2024
5df9a2c
Remove synchronized sections for debugging
Apr 11, 2024
05bf1d8
Merge remote-tracking branch 'origin/proto-without-grpc' into proto-w…
Apr 11, 2024
89d684b
added consistent handling for untyped array and precision to types in…
datomo Apr 12, 2024
c1dde0c
Merge branch 'proto-without-grpc' of github.com:polypheny/Polypheny-D…
datomo Apr 12, 2024
11c624d
fix for binary in mongo media, fixes, added handling for statistics w…
datomo Apr 15, 2024
b13ad15
added workaround for dead statements in PI, maybe needs handling
datomo Apr 15, 2024
d6e1be3
Improve event loop
gartens Apr 11, 2024
3e91019
Improve method name
Apr 17, 2024
3345101
Fix wrong response message
Apr 17, 2024
ea7e383
Add null guards for non-null poly values being null during serialization
Apr 17, 2024
a58e768
Disable hanging test
Apr 17, 2024
698c094
Add transport version checks
gartens Apr 18, 2024
58fcdb8
Update name of parameters and methods
gartens Apr 18, 2024
e6439e9
Exchange version only once
gartens Apr 18, 2024
caa2255
added support for select null, added support for binary/varbinary/etc…
datomo Apr 18, 2024
dfb6d37
Merge branch 'proto-without-grpc' of github.com:polypheny/Polypheny-D…
datomo Apr 18, 2024
619fb04
Remove unused Exception from method signature
gartens Apr 19, 2024
f5e0288
Remove unused import
gartens Apr 19, 2024
a220828
Fix typos
gartens Apr 19, 2024
3741bd1
fixed named dynamic parameters
datomo Apr 19, 2024
b0be702
Merge branch 'proto-without-grpc' of github.com:polypheny/Polypheny-D…
datomo Apr 19, 2024
0c992e2
Bump protobuf
gartens Apr 19, 2024
a5b490c
Build the driver in the workflow until it has been released
gartens Apr 19, 2024
941e249
Fix tests
gartens Apr 19, 2024
98290e1
Build driver for plugin tests
gartens Apr 19, 2024
2aab265
Fix HorizontalPartitioningTest
gartens Apr 19, 2024
b147cba
Fix ArrayTest
gartens Apr 19, 2024
5e61b56
Fix VerticalPartitioningTest
gartens Apr 19, 2024
971c8fa
Fix formatting and update year in copyright
vogti Apr 19, 2024
5c3edaf
Fix SelectTest
gartens Apr 19, 2024
8b059c0
Fix CqlTestHelper
gartens Apr 19, 2024
a07a1b9
Create document namespace for MqlTest
gartens Apr 19, 2024
a1ba3b4
Add missing import
gartens Apr 19, 2024
a1bac07
Prepare for merge
vogti Apr 19, 2024
9a9ab6c
Cherry-pick docker improvements
vogti Apr 19, 2024
635c1c1
Delete scannable entity
vogti Apr 19, 2024
f1c4178
Merge branch 'master' into proto-without-grpc
vogti Apr 19, 2024
ce0db61
Minor post-merge fixes
vogti Apr 19, 2024
76b91f2
Fix typos and adjust tests
vogti Apr 19, 2024
f1db701
Fix MqlTestTemplate
gartens Apr 19, 2024
ccde81f
Fix CatalogTest
gartens Apr 19, 2024
ae00081
Fix JdbcMetaTest
gartens Apr 19, 2024
f51ed37
Sync protofiles
gartens Apr 19, 2024
8509969
Remove unused calls
gartens Apr 19, 2024
034d7a4
Do not build test classes
vogti Apr 20, 2024
f81f3b9
clean-up and re-organizing of TestHelper to handle Arrays consistently
datomo Apr 21, 2024
b538ffa
added flag for auto-generated queries, e.g. mql non-existing collections
datomo Apr 22, 2024
b339cb0
moved return size of neo4j relational prepared handling to runtime
datomo Apr 22, 2024
304c540
Add flag to prevent AutoDocker setup
gartens Apr 23, 2024
23463d9
Fix ProtoValueTest
gartens Apr 24, 2024
7ed34c8
Complete named value processor tests
Apr 24, 2024
01a53e6
fixed restore of idBuilder
datomo Apr 24, 2024
f5c1f42
Use variables for protobuf version
gartens Apr 24, 2024
2e446d0
Improve and clean-up build file
vogti Apr 25, 2024
8c615ae
Use protobuf version from gradle.properties
vogti Apr 25, 2024
07eeeec
Add task dependency declaration
vogti Apr 29, 2024
be2f887
adjustment to block autogenerated queries from jdbc interface
datomo Apr 29, 2024
1270952
Fix RelationalOnDocumentTest
gartens Apr 30, 2024
b483e3c
Remove outdated comment
gartens Apr 30, 2024
88d35db
Fix unit test
Apr 30, 2024
3fde13b
Merge remote-tracking branch 'origin/proto-without-grpc' into proto-w…
Apr 30, 2024
b4a6117
Expose isReady over HTTP
gartens Apr 30, 2024
21bd24e
Fix & clean up proto interface tests
gartens May 2, 2024
821fb23
added estimation for ANY types in jdbc, to handle some ARRAY edge cases
datomo May 2, 2024
ac98211
Fix mongo add find test
May 2, 2024
b52bc3e
Merge remote-tracking branch 'origin/proto-without-grpc' into proto-w…
May 2, 2024
7b7634c
Handle some PolyBinary cases in Cottontail
gartens May 3, 2024
15449a7
Fix JdbcResultSetTest
gartens May 3, 2024
009ef06
Fix JdbcStatementTest
gartens May 3, 2024
e2edc98
Remove debug output
gartens May 3, 2024
1a7876b
Fix UniqueConstraintTest
gartens May 3, 2024
63d73eb
Get api version from gradle
May 5, 2024
cfb1dcd
Sync proto files
May 5, 2024
c109244
Update package name
May 5, 2024
36dcf15
Remove dead code
May 5, 2024
cb4d31b
Sync proto project structure
May 5, 2024
1cf1a29
Add compilation and version retrieval from prism package
May 5, 2024
b1f7dbc
Fix file name
May 5, 2024
9e9fd59
Do not extract proto files but use files from dependency
vogti May 5, 2024
9837b43
Minor improvements to formatting and optimize imports
vogti May 5, 2024
563f7eb
Change interface description
May 6, 2024
b1ee9c9
Merge remote-tracking branch 'origin/proto-without-grpc' into proto-w…
May 6, 2024
64fb91d
Make custom type names consistent
May 6, 2024
e356f41
Add unit tests for null sorting
May 6, 2024
7d50f35
some guardrails for neo4j
datomo May 6, 2024
e0bc1b9
moved physical schema operations (ddls) to commit, after integrity ch…
datomo May 7, 2024
43c31ac
moved some copy and logistics code into commit actions to fix failing…
datomo May 8, 2024
910be48
Fix some operators
gartens May 8, 2024
10393b3
Use Polypheny JDBC driver version 2.0
vogti May 10, 2024
b2b4e6e
Bump licensee and license report version and adjust workflow job title
vogti May 10, 2024
5b7f386
Bump gradle wrapper version and switch to foojay 0.8.0
vogti May 10, 2024
64c0420
Declare toolchain and print java version
vogti May 10, 2024
e3a4daa
Rename from proto to prism
vogti May 10, 2024
d993897
Fix socket in .polypheny folder
vogti May 10, 2024
c379d5d
fixes for isnull checks in various stores
datomo May 13, 2024
abe981e
fixes for isNull with arrays
datomo May 13, 2024
fb77d06
some fixes for Decimal scaling
datomo May 13, 2024
74e67f3
added tests for too large rel values, consistently error on insert now
datomo May 14, 2024
d54be19
fixed incorrect handling of number delimiter in type<->value check in…
datomo May 14, 2024
a3e432c
added correct type to batching
datomo May 14, 2024
54b20bd
fix for negative value check
datomo May 14, 2024
3336e6e
fix for null values
datomo May 14, 2024
3b9eba8
fixes for correct length extracting, and null values in prep. statements
datomo May 14, 2024
4a81ad0
handling for chars in stream operator
datomo May 14, 2024
75ba8e7
fixes for scale in mongodb
datomo May 14, 2024
8183c31
fix for unnecessary parameter
datomo May 14, 2024
90e2cc0
fixed condition for extra parameters
datomo May 14, 2024
5419e98
fixes for monetdb, fixes for edge case prepared queries, fixes for mo…
datomo May 14, 2024
02ca9f0
fixes for big neo4j numbers
datomo May 14, 2024
9c1776f
fixed monetdb and neo4j edge cases
datomo May 15, 2024
d98ae45
fixed various test which struggle with mixed prepared statements
datomo May 15, 2024
590a6d4
fix for PolyFloat to BigDecimal
datomo May 15, 2024
81cbf83
Do best-effort cleanup of socket files on shutdown
gartens May 15, 2024
dd6a71d
Fix system functions retrieval
May 15, 2024
3bf8001
Omit log message during shutdown
gartens May 15, 2024
8968c05
fix for BigDecimal equal and operatorRegistry
datomo May 15, 2024
380da62
Use instanceof pattern matching like in PolyNumber
gartens May 15, 2024
e8f2eb0
reverted hashcode method
datomo May 15, 2024
7fde733
Merge branch 'proto-without-grpc' of https://github.com/polypheny/Pol…
datomo May 15, 2024
bff41c3
fixed contains entity and cottontail
datomo May 15, 2024
2633272
fix for binary functions in neo4j
datomo May 15, 2024
9197b77
fix for missing Neo4j mapping
datomo May 16, 2024
9430d2d
fix for Neo4j date type
datomo May 16, 2024
665d503
removed comments with synchronize
datomo May 16, 2024
c9b3cff
adjusted licensee headers, reformated and optimized imports for all c…
datomo May 16, 2024
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
28 changes: 11 additions & 17 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,27 @@ jobs:
fail-fast: false
matrix:
adapter: [ mongodb, hsqldb, monetdb, postgresql, file, cottontail, neo4j ]
name: Integration Tests (Java 17)
name: ${{ matrix.adapter }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21
- name: Set env variable
run: |
echo "POLYPHENY_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Print Java Version
timeout-minutes: 5
run: ./gradlew printJavaVersion
- name: Assemble
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
command: ./gradlew assemble
timeout-minutes: 10
run: ./gradlew assemble
- name: Build Plugins
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
command: ./gradlew assemblePlugins
timeout-minutes: 5
run: ./gradlew assemblePlugins
- name: Execute integration tests for ${{ matrix.adapter }}
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 30
command: ./gradlew integrationTests -Dstore.default=${{ matrix.adapter }}
timeout-minutes: 30
run: ./gradlew integrationTests -Dstore.default=${{ matrix.adapter }}
24 changes: 9 additions & 15 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,15 @@ jobs:
- name: Set env variable
run: |
echo "POLYPHENY_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Print Java Version
timeout-minutes: 5
run: ./gradlew printJavaVersion
- name: Assemble
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
command: ./gradlew assemble
timeout-minutes: 60
run: ./gradlew assemble
- name: Build Plugins
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
command: ./gradlew assemblePlugins
timeout-minutes: 60
run: ./gradlew assemblePlugins
- name: Execute tests
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 30
command: ./gradlew check
timeout-minutes: 30
run: ./gradlew check
29 changes: 11 additions & 18 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,28 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 17, 21 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
name: Java ${{ matrix.java }} @ ${{ matrix.os }}
name: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
java-version: 21
- name: Set env variable
run: |
echo "POLYPHENY_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Print Java Version
timeout-minutes: 5
run: ./gradlew printJavaVersion
- name: Assemble
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
command: ./gradlew assemble
timeout-minutes: 60
run: ./gradlew assemble
- name: Build Plugins
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
command: ./gradlew assemblePlugins
timeout-minutes: 60
run: ./gradlew assemblePlugins
- name: Execute tests
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 30
command: ./gradlew -p plugins test
timeout-minutes: 30
run: ./gradlew -p plugins test
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ allprojects {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion.set(JavaLanguageVersion.of(17))
vendor = JvmVendorSpec.ADOPTIUM
}
}

Expand Down Expand Up @@ -203,6 +204,27 @@ allprojects {
}


task printJavaVersion {
doLast {
println("Java version used for running Gradle: " + org.gradle.api.JavaVersion.current())
println "Current JAVA_HOME used by Gradle: " + System.getProperty("java.home")

// Retrieve and print the Java version configured in the toolchain
// Check if a toolchain is configured and retrieve details
if (project.extensions.findByType(JavaPluginExtension.class)?.toolchain != null) {
def toolchainService = project.extensions.getByType(JavaToolchainService.class)
def javaCompiler = toolchainService.compilerFor {
languageVersion.set(project.extensions.getByType(JavaPluginExtension.class).toolchain.languageVersion.get())
}
println "Java version used by toolchain: " + javaCompiler.get().metadata.languageVersion
println "Toolchain JAVA_HOME: " + javaCompiler.get().metadata.installationPath
} else {
println "No toolchain configured."
}
}
}


idea {
project {
settings {
Expand Down
9 changes: 7 additions & 2 deletions core/src/main/java/org/polypheny/db/ResultIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public ResultIterator( Iterator<PolyValue[]> iterator, Statement statement, int


public List<List<PolyValue>> getNextBatch() {
return getNextBatch( batch );
}


public List<List<PolyValue>> getNextBatch( int fetchSize ) {
StopWatch stopWatch = null;
try {
if ( isTimed ) {
Expand All @@ -70,7 +75,7 @@ public List<List<PolyValue>> getNextBatch() {
}
List<List<PolyValue>> res = new ArrayList<>();
int i = 0;
while ( (batch < 0 || i++ < batch) && iterator.hasNext() ) {
while ( (fetchSize < 0 || i++ < fetchSize) && iterator.hasNext() ) {
res.add( Lists.newArrayList( iterator.next() ) );
}

Expand Down Expand Up @@ -134,7 +139,7 @@ public List<PolyValue[]> getArrayRows() {


@Override
public void close() throws Exception {
public void close() {
try {
if ( iterator instanceof AutoCloseable ) {
((AutoCloseable) iterator).close();
Expand Down
11 changes: 6 additions & 5 deletions core/src/main/java/org/polypheny/db/adapter/DataContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.calcite.linq4j.QueryProvider;
import org.apache.calcite.linq4j.tree.Expressions;
import org.apache.calcite.linq4j.tree.ParameterExpression;
import org.jetbrains.annotations.NotNull;
import org.polypheny.db.adapter.java.JavaTypeFactory;
import org.polypheny.db.algebra.type.AlgDataType;
import org.polypheny.db.catalog.snapshot.Snapshot;
Expand Down Expand Up @@ -77,17 +78,17 @@ public interface DataContext {
Statement getStatement();


void addParameterValues( long index, AlgDataType type, List<PolyValue> data );
void addParameterValues( long index, @NotNull AlgDataType type, List<PolyValue> data );

AlgDataType getParameterType( long index );

List<Map<Long, PolyValue>> getParameterValues();

void setParameterValues( List<Map<Long, PolyValue>> values );

Map<Long, AlgDataType> getParameterTypes();
Map<Long, @NotNull AlgDataType> getParameterTypes();

void setParameterTypes( Map<Long, AlgDataType> types );
void setParameterTypes( Map<Long, @NotNull AlgDataType> types );

default void resetParameterValues() {
throw new UnsupportedOperationException();
Expand Down Expand Up @@ -118,7 +119,7 @@ default void resetContext() {
}


record ParameterValue(long index, AlgDataType type, PolyValue value) {
record ParameterValue( long index, AlgDataType type, PolyValue value ) {

}

Expand Down Expand Up @@ -239,7 +240,7 @@ public Statement getStatement() {


@Override
public void addParameterValues( long index, AlgDataType type, List<PolyValue> data ) {
public void addParameterValues( long index, @NotNull AlgDataType type, List<PolyValue> data ) {

}

Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/org/polypheny/db/adapter/Modifiable.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,6 @@ static void dropGraphSubstitute( Modifiable modifiable, long allocation ) {
}


static void dropCollectionSubstitute( Modifiable modifiable, long allocation ) {
modifiable.getCatalog().removeAllocAndPhysical( allocation );
}


default AlgNode getModify( long allocId, Modify<?> modify, AlgBuilder builder ) {
if ( modify.getEntity().unwrap( AllocationTable.class ).isPresent() ) {
return getRelModify( allocId, (RelModify<?>) modify, builder );
Expand Down
9 changes: 7 additions & 2 deletions core/src/main/java/org/polypheny/db/algebra/AlgNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public interface AlgNode extends AlgOptNode, Cloneable {
AlgDataType getTupleType();



/**
* Returns the type of the rows expected for an input. Defaults to {@link #getTupleType}.
*
Expand Down Expand Up @@ -353,7 +352,6 @@ default boolean isImplementationCacheable() {
* Expands node
* If a part of AlgNode is a LogicalViewScan it is replaced
* Else recursively hands call down if view in deeper level
*
*/
default AlgNode unfoldView( @Nullable AlgNode parent, int index, AlgCluster cluster ) {
int i = 0;
Expand Down Expand Up @@ -387,6 +385,13 @@ default boolean containsScan() {
return getInputs().stream().anyMatch( AlgNode::containsScan );
}

default boolean containsEntity() {
if ( getEntity() != null ) {
return true;
}
return getInputs().stream().anyMatch( AlgNode::containsEntity );
}

/**
* Context of an algebra expression, for purposes of checking validity.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ static Expression joinSelector( JoinAlgType joinType, PhysType physType, List<Ph
if ( joinType.generatesNullsOn( ord.i ) ) {
expression =
EnumUtils.condition(
Expressions.equal( parameter, Expressions.constant( null ) ),
Expressions.constant( null ),//PolyValue.getNull( inputPhysType.field( i ).fieldClass( 0 ) ).asExpression(),
PolyValue.isNullExpression( parameter ),
Expressions.constant( null ),
expression );
}
expressions.add( expression );
Expand Down Expand Up @@ -255,7 +255,6 @@ static Type fromInternal( Type type ) {
}



static Expression enforce( final Type storageType, final Expression e ) {
if ( storageType != null && e.type != storageType ) {
if ( e.type == java.sql.Date.class ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static Expression optimize2( Expression operand, Expression expression ) {
// Primitive values cannot be null
return optimize( expression );
} else {
return optimize( EnumUtils.condition( Expressions.equal( operand, NULL_EXPR ), NULL_EXPR, expression ) );
return optimize( EnumUtils.condition( PolyValue.isNullExpression( operand ), NULL_EXPR, expression ) );
}
}

Expand Down Expand Up @@ -922,8 +922,8 @@ public Expression handle( Expression x ) {
case NULL, NOT_POSSIBLE -> x;
case FALSE -> Expressions.call( BuiltInMethod.IS_TRUE.method, x );
case TRUE -> Expressions.call( BuiltInMethod.IS_NOT_FALSE.method, x );
case IS_NULL -> Expressions.new_( PolyBoolean.class, Expressions.equal( x, NULL_EXPR ) );
case IS_NOT_NULL -> Expressions.new_( PolyBoolean.class, Expressions.notEqual( x, NULL_EXPR ) );
case IS_NULL -> Expressions.new_( PolyBoolean.class, PolyValue.isNullExpression( x ) );
case IS_NOT_NULL -> Expressions.new_( PolyBoolean.class, Expressions.equal( PolyValue.isNullExpression( x ), Expressions.constant( false ) ) );
};
}
}
Expand Down Expand Up @@ -1962,7 +1962,7 @@ public Expression implement( RexToLixTranslator translator, RexCall call, List<E
}


private record MqlMethodNameImplementor(String methodName) implements NotNullImplementor {
private record MqlMethodNameImplementor( String methodName ) implements NotNullImplementor {


@Override
Expand All @@ -1976,7 +1976,7 @@ public Expression implement( RexToLixTranslator translator, RexCall call, List<E
/**
* Implementor for binary operators.
*/
private record BinaryImplementor(ExpressionType expressionType, String backupMethodName) implements NotNullImplementor {
private record BinaryImplementor( ExpressionType expressionType, String backupMethodName ) implements NotNullImplementor {

/**
* Types that can be arguments to comparison operators such as {@code <}.
Expand Down Expand Up @@ -2069,7 +2069,7 @@ private Expression maybeBox( Expression expression ) {
/**
* Implementor for unary operators.
*/
private record UnaryImplementor(ExpressionType expressionType) implements NotNullImplementor {
private record UnaryImplementor( ExpressionType expressionType ) implements NotNullImplementor {


@Override
Expand Down Expand Up @@ -2587,7 +2587,7 @@ public Expression implement( RexToLixTranslator translator, RexCall call, NullAs
* 2. Of the 3 input values (TRUE, FALSE, NULL) they return TRUE for 1 or 2,
* FALSE for the other 2 or 1.
*/
private record IsXxxImplementor(Boolean seek, boolean negate) implements CallImplementor {
private record IsXxxImplementor( Boolean seek, boolean negate ) implements CallImplementor {


@Override
Expand Down Expand Up @@ -2619,7 +2619,7 @@ public Expression implement( RexToLixTranslator translator, RexCall call, NullAs
/**
* Implementor for the {@code NOT} operator.
*/
private record NotImplementor(NotNullImplementor implementor) implements NotNullImplementor {
private record NotImplementor( NotNullImplementor implementor ) implements NotNullImplementor {


static NotNullImplementor of( NotNullImplementor implementor ) {
Expand Down
Loading