Class CalciteSystemProperty<T>

  • Type Parameters:
    T - the type of the property value

    public final class CalciteSystemProperty<T>
    extends java.lang.Object
    A Calcite specific system property that is used to configure various aspects of the framework.

    Calcite system properties must always be in the "calcite" root namespace.

    • Field Detail


        private static final java.util.Properties PROPERTIES
        Holds all system properties related with the Calcite.

        Deprecated "" (in namespaces"saffron" and "net.sf.saffron") are also kept here but under "calcite" namespace.

      • DEBUG

        public static final CalciteSystemProperty<java.lang.Boolean> DEBUG
        Whether to run Calcite in debug mode.

        When debug mode is activated significantly more information is gathered and printed to STDOUT. It is most commonly used to print and identify problems in generated java code. Debug mode is also used to perform more verifications at runtime, which are not performed during normal execution.

      • COMMUTE

        public static final CalciteSystemProperty<java.lang.Boolean> COMMUTE
        Whether to exploit join commutative property.

        public static final CalciteSystemProperty<java.lang.Boolean> ENABLE_COLLATION_TRAIT
        Whether to enable the collation trait in the default planner configuration.

        Some extra optimizations are possible if enabled, but queries should work either way. At some point this will become a preference, or we will run multiple phases: first disabled, then enabled.


        public static final CalciteSystemProperty<java.lang.Boolean> ENABLE_ENUMERABLE
        Whether the enumerable convention is enabled in the default planner configuration.

        public static final CalciteSystemProperty<java.lang.Boolean> ENABLE_STREAM
        Whether streaming is enabled in the default planner configuration.
      • STRICT

        public static final CalciteSystemProperty<java.lang.Boolean> STRICT
        Whether to follow the SQL standard strictly.

        public static final CalciteSystemProperty<java.lang.Boolean> DUMP_GRAPHVIZ
        Whether to include a GraphViz representation when dumping the state of the Volcano planner.
      • DUMP_SETS

        public static final CalciteSystemProperty<java.lang.Boolean> DUMP_SETS
        Whether to include RelSet information when dumping the state of the Volcano planner.

        public static final CalciteSystemProperty<java.lang.Boolean> INTEGRATION_TEST
        Whether to run integration tests.
      • TEST_DB

        public static final CalciteSystemProperty<java.lang.String> TEST_DB
        Which database to use for tests that require a JDBC data source.

        The property can take one of the following values:

        • HSQLDB (default)
        • H2
        • MYSQL
        • ORACLE
        • POSTGRESQL

        If the specified value is not included in the previous list, the default is used.

        We recommend that casual users use hsqldb, and frequent Calcite developers use MySQL. The test suite runs faster against the MySQL database (mainly because of the 0.1 second versus 6 seconds startup time). You have to populate MySQL manually with the foodmart data set, otherwise there will be test failures.


        public static final CalciteSystemProperty<java.lang.String> TEST_DATASET_PATH
        Path to the dataset file that should used for integration tests.

        If a path is not set, then one of the following values will be used:

        • ../calcite-test-dataset
        • ../../calcite-test-dataset
        • .
        The first valid path that exists in the filesystem will be chosen.
      • TEST_SLOW

        public static final CalciteSystemProperty<java.lang.Boolean> TEST_SLOW
        Whether to run slow tests.

        public static final CalciteSystemProperty<java.lang.Boolean> TEST_MONGODB
        Whether to run MongoDB tests.

        public static final CalciteSystemProperty<java.lang.Boolean> TEST_SPLUNK
        Whether to run Splunk tests.

        Disabled by default, because we do not expect Splunk to be installed and populated with the data set necessary for testing.

      • TEST_DRUID

        public static final CalciteSystemProperty<java.lang.Boolean> TEST_DRUID
        Whether to run Druid tests.

        public static final CalciteSystemProperty<java.lang.Boolean> TEST_CASSANDRA
        Whether to run Cassandra tests.

        public static final CalciteSystemProperty<java.lang.String> TEST_FOODMART_QUERY_IDS
        A list of ids designating the queries (from query.json in new.hydromatic:foodmart-queries:0.4.1) that should be run as part of FoodmartTest.

        public static final CalciteSystemProperty<java.lang.Boolean> ALLOW_INFINITE_COST_CONVERTERS
        Whether the optimizer will consider adding converters of infinite cost in order to convert a relational expression from one calling convention to another.

        public static final CalciteSystemProperty<java.lang.Integer> METADATA_HANDLER_CACHE_MAXIMUM_SIZE
        The maximum size of the cache of metadata handlers.

        A typical value is the number of queries being concurrently prepared multiplied by the number of types of metadata.

        If the value is less than 0, there is no limit.


        public static final CalciteSystemProperty<java.lang.Integer> BINDABLE_CACHE_MAX_SIZE
        The maximum size of the cache used for storing Bindable objects, instantiated via dynamically generated Java classes.

        The default value is 0.

        The property can take any value between [0, Integer.MAX_VALUE] inclusive. If the value is not valid (or not specified) then the default value is used.

        The cached objects may be quite big so it is suggested to use a rather small cache size (e.g., 1000). For the most common use cases a number close to 1000 should be enough to alleviate the performance penalty of compiling and loading classes.

        Setting this property to 0 disables the cache.


        public static final CalciteSystemProperty<java.lang.Integer> BINDABLE_CACHE_CONCURRENCY_LEVEL
        The concurrency level of the cache used for storing Bindable objects, instantiated via dynamically generated Java classes.

        The default value is 1.

        The property can take any value between [1, Integer.MAX_VALUE] inclusive. If the value is not valid (or not specified) then the default value is used.

        This property has no effect if the cache is disabled (i.e., BINDABLE_CACHE_MAX_SIZE set to 0.

      • value

        private final T value
    • Constructor Detail

      • CalciteSystemProperty

        private CalciteSystemProperty​(java.lang.String key,
                                      java.util.function.Function<java.lang.String,​T> valueParser)
    • Method Detail

      • booleanProperty

        private static CalciteSystemProperty<java.lang.Boolean> booleanProperty​(java.lang.String key,
                                                                                boolean defaultValue)
      • intProperty

        private static CalciteSystemProperty<java.lang.Integer> intProperty​(java.lang.String key,
                                                                            int defaultValue)
      • intProperty

        private static CalciteSystemProperty<java.lang.Integer> intProperty​(java.lang.String key,
                                                                            int defaultValue,
                                                                            java.util.function.IntPredicate valueChecker)
        Returns the value of the system property with the specified name as int, or the defaultValue if any of the conditions below hold:
        1. the property is not defined;
        2. the property value cannot be transformed to an int;
        3. the property value does not satisfy the checker.
      • stringProperty

        private static CalciteSystemProperty<java.lang.String> stringProperty​(java.lang.String key,
                                                                              java.lang.String defaultValue)
      • stringProperty

        private static CalciteSystemProperty<java.lang.String> stringProperty​(java.lang.String key,
                                                                              java.lang.String defaultValue,
                                                                              java.util.Set<java.lang.String> allowedValues)
      • loadProperties

        private static java.util.Properties loadProperties()
      • value

        public T value()
        Returns the value of this property.
        the value of this property or null if a default value has not been defined for this property.