-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1670 from johnedquinn/v1-spi
Adds a built-in PartiQL System catalog, support for SQL-Path, and SPI cleanup
- Loading branch information
Showing
13 changed files
with
122 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
partiql-spi/src/main/java/org/partiql/spi/catalog/System.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.partiql.spi.catalog; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.partiql.spi.function.Aggregation; | ||
import org.partiql.spi.function.Builtins; | ||
import org.partiql.spi.function.Function; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* <p> | ||
* This package-private class implements the PartiQL System Catalog. | ||
* </p> | ||
* <p> | ||
* It provides the implementation for the PartiQL System Catalog, which is a built-in catalog | ||
* that provides access to the PartiQL language and its built-in functions and aggregations. | ||
* </p> | ||
* @see Session.Builder | ||
*/ | ||
final class System implements Catalog { | ||
|
||
@NotNull | ||
private static final String NAME = "$system"; | ||
|
||
/** | ||
* This is a package-private singleton. | ||
*/ | ||
static System INSTANCE = new System(); | ||
|
||
@NotNull | ||
@Override | ||
public String getName() { | ||
return NAME; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Table getTable(@NotNull Session session, @NotNull Name name) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Name resolveTable(@NotNull Session session, @NotNull Identifier identifier) { | ||
return null; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public Collection<Function> getFunctions(@NotNull Session session, @NotNull String name) { | ||
return Builtins.INSTANCE.getFunctions(name); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public Collection<Aggregation> getAggregations(@NotNull Session session, @NotNull String name) { | ||
return Builtins.INSTANCE.getAggregations(name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.