Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class DefaultExtensionCatalog {

/** Extension identifier for string functions. */
public static final String FUNCTIONS_STRING = "extension:io.substrait:functions_string";

public static final String EXTENSION_TYPES = "extension:io.substrait:extension_types";

/** Default collection of built-in extensions loaded from YAML resources. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ private SchemaHelper() {}
* Parses one or more SQL strings containing only CREATE statements into a {@link
* CalciteCatalogReader}
*
* @param createStatements a SQL string containing only CREATE statements
* @param createStatements a list of SQL strings containing only CREATE statements
* @return a {@link CalciteCatalogReader} generated from the CREATE statements
* @throws SqlParseException
* @throws SqlParseException if any of the SQL strings can not be parsed
*/
public static CalciteSchema processCreateStatementsToSchema(final List<String> createStatements)
throws SqlParseException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@
import io.substrait.util.EmptyVisitationContext;
import java.util.List;

/** ExpressionStringify gives a simple debug text output for Expressions */
/** ExpressionStringify gives a simple debug text output for Expressions. */
public class ExpressionStringify extends ParentStringify
implements ExpressionVisitor<String, EmptyVisitationContext, RuntimeException> {

/**
* Constructor.
*
* @param indent indent size
*/
public ExpressionStringify(int indent) {
super(indent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
public class FunctionArgStringify extends ParentStringify
implements FuncArgVisitor<String, EmptyVisitationContext, RuntimeException> {

/**
* Constructor
*
* @param indent number of indents to use
*/
public FunctionArgStringify(int indent) {
super(indent);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
package io.substrait.examples.util;

/**
* Parent class of all stringifiers Created as it seemed there could be an optimization to share
* formatting fns between the various stringifiers
* Parent class of all string-ifiers Created as it seemed there could be an optimization to share
* formatting fns between the various string-ifiers
*/
public class ParentStringify {

/** Indent character. */
protected String indentChar = " ";

/** Number of indents to use. */
protected int indent;

/** Size of each indent. */
protected int indentSize = 3;

/**
* Build with a specific indent at the start - note 'an indent' is set by default to be 3 spaces.
*
* @param indent number of indentes
* @param indent Number of indents to use.
*/
public ParentStringify(int indent) {
this.indent = indent;
Expand Down Expand Up @@ -50,6 +55,12 @@ StringBuilder getContinuationIndentString() {
return sb;
}

/**
* Get the outdent to use, decrements indent counter.
*
* @param sb StringBuilder with outdent
* @return outdent string
*/
protected String getOutdent(StringBuilder sb) {
indent--;
return (sb).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class SubstraitStringify extends ParentStringify

private boolean showRemap = false;

/** Constructor. */
public SubstraitStringify() {
super(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@
import io.substrait.type.Type.VarChar;
import io.substrait.type.TypeVisitor;

/** TypeStringify produces a simple debug string of Substrait types */
/** TypeStringify produces a simple debug string of Substrait types. */
public class TypeStringify extends ParentStringify
implements TypeVisitor<String, RuntimeException> {

/**
* Constructor.
*
* @param indent Number of indents to use.
*/
protected TypeStringify(int indent) {
super(indent);
}
Expand Down
7 changes: 7 additions & 0 deletions isthmus-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,10 @@ tasks.register("writeIsthmusVersion") {
}

tasks.named("compileJava") { dependsOn("writeIsthmusVersion") }

tasks.named<Javadoc>("javadoc") {
description = "Generate Javadoc for main source files (excludes generated)."

val isthmusVersionClass = layout.buildDirectory.file("generated/sources").get().getAsFile()
exclude { spec -> spec.file.toPath().startsWith(isthmusVersionClass.toPath()) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package io.substrait.isthmus.cli;

/** */
public class InitializeAtBuildTime {}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;

/** Isthmus CLI entry point. */
@Command(
name = "isthmus",
versionProvider = io.substrait.isthmus.cli.IsthmusCliVersion.class,
Expand Down Expand Up @@ -61,6 +62,11 @@ enum OutputFormat {
description = "Calcite's casing policy for unquoted identifiers: ${COMPLETION-CANDIDATES}")
private Casing unquotedCasing = Casing.TO_UPPER;

/**
* Standard Java Main method.
*
* @param args Isthmus CLI arguments.
*/
public static void main(String... args) {
CommandLine commandLine = new CommandLine(new IsthmusEntryPoint());
commandLine.setCaseInsensitiveEnumValuesAllowed(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
import org.graalvm.nativeimage.hosted.RuntimeReflection;
import org.immutables.value.Value;

/**
* GraalVM {@link Feature} used during native image generation which registers classes for
* reflection at runtime using {@link RuntimeReflection}.
*/
public final class RegisterAtRuntime implements Feature {
@Override
public void beforeAnalysis(BeforeAnalysisAccess access) {
Expand Down
2 changes: 1 addition & 1 deletion substrait
Submodule substrait updated 78 files
+1 −3 .flake8
+0 −2 .gitattributes
+1 −1 .github/CODEOWNERS
+1 −1 .github/workflows/licence_check.yml
+33 −24 .github/workflows/pr.yml
+1 −1 .github/workflows/pr_breaking.yml
+1 −1 .github/workflows/pr_title.yml
+2 −2 .github/workflows/release.yml
+1 −1 .github/workflows/site.yml
+0 −24 .github/workflows/stale.yml
+0 −35 CHANGELOG.md
+2 −2 CODE_OF_CONDUCT.md
+0 −14 CONTRIBUTING.md
+1 −2 extensions/functions_comparison.yaml
+0 −43 extensions/functions_list.yaml
+0 −1 grammar/FuncTestCaseLexer.g4
+42 −87 grammar/FuncTestCaseParser.g4
+0 −2 grammar/SubstraitLexer.g4
+0 −6 grammar/SubstraitType.g4
+8 −65 proto/substrait/algebra.proto
+1 −1 proto/substrait/extensions/extensions.proto
+0 −17 proto/substrait/type.proto
+1 −6 pyproject.toml
+1 −2 requirements.txt
+2 −2 site/data/committers.yaml
+0 −2 site/data/smc.yaml
+0 −7 site/docs/expressions/field_references.md
+0 −137 site/docs/expressions/lambda_expressions.md
+3 −3 site/docs/expressions/scalar_functions.md
+22 −2 site/docs/expressions/user_defined_functions.md
+40 −26 site/docs/extensions/index.md
+15 −15 site/docs/governance.md
+9 −20 site/docs/relations/logical_relations.md
+6 −6 site/docs/relations/physical_relations.md
+9 −4 site/docs/serialization/binary_serialization.md
+62 −30 site/docs/types/type_classes.md
+0 −18 site/docs/types/type_parsing.md
+0 −28 site/examples/README.md
+0 −11 site/examples/extensions/any1_type_function.yaml
+0 −11 site/examples/extensions/any_type_function.yaml
+0 −13 site/examples/extensions/distance_functions.yaml
+0 −22 site/examples/extensions/double_function.yaml
+0 −22 site/examples/extensions/lambda_function_example.yaml
+0 −11 site/examples/proto-textformat/README.md
+0 −32 site/examples/proto-textformat/field_reference/lambda_param_nested_struct.textproto
+0 −22 site/examples/proto-textformat/lambda/nested_lambda_capture.textproto
+0 −49 site/examples/proto-textformat/lambda/simple_multiply.textproto
+0 −66 site/examples/proto-textformat/lambda_invocation/inline_invocation.textproto
+0 −10 site/examples/types/point_with_datatype_param.yaml
+0 −10 site/examples/types/point_with_enum_param.yaml
+0 −5 site/examples/types/point_with_nstruct.yaml
+0 −7 site/examples/types/point_with_structure.yaml
+0 −9 site/examples/types/point_with_two_params.yaml
+0 −9 site/examples/types/tuple_optional_variadic.yaml
+0 −8 site/examples/types/union_variadic.yaml
+0 −18 site/examples/types/user_defined_point.yaml
+0 −11 site/examples/types/vector_with_constraints.yaml
+0 −1 site/mkdocs.yml
+6 −36 tests/README.md
+14 −14 tests/baseline.json
+1 −0 tests/cases/comparison/equal.test
+0 −3 tests/cases/comparison/nullif.test
+0 −12 tests/cases/list/filter.test
+0 −11 tests/cases/list/transform.test
+575 −594 tests/coverage/antlr_parser/FuncTestCaseLexer.py
+1,514 −2,178 tests/coverage/antlr_parser/FuncTestCaseParser.py
+32 −113 tests/coverage/antlr_parser/FuncTestCaseParserListener.py
+16 −61 tests/coverage/antlr_parser/FuncTestCaseParserVisitor.py
+0 −1 tests/coverage/extensions.py
+1 −2 tests/coverage/nodes.py
+2 −55 tests/coverage/test_coverage.py
+16 −21 tests/coverage/visitor.py
+0 −65 tests/test_proto_example_validator.py
+318 −326 tests/type/antlr_parser/SubstraitLexer.py
+318 −326 tests/type/antlr_parser/SubstraitTypeLexer.py
+0 −27 tests/type/antlr_parser/SubstraitTypeListener.py
+474 −683 tests/type/antlr_parser/SubstraitTypeParser.py
+0 −15 tests/type/antlr_parser/SubstraitTypeVisitor.py