flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] hequn8128 commented on a change in pull request #8050: [FLINK-11067][table] Convert TableEnvironments to interfaces
Date Wed, 17 Apr 2019 12:15:06 GMT
hequn8128 commented on a change in pull request #8050: [FLINK-11067][table] Convert TableEnvironments
to interfaces
URL: https://github.com/apache/flink/pull/8050#discussion_r276210328
 
 

 ##########
 File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java
 ##########
 @@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.api;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.GlobalConfiguration;
+import org.apache.flink.util.Preconditions;
+
+import java.math.MathContext;
+import java.util.Optional;
+import java.util.TimeZone;
+
+/**
+ * A config to define the runtime behavior of the Table API.
+ */
+@PublicEvolving
+public class TableConfig {
+
+	/**
+	 * Defines the timezone for date/time/timestamp conversions.
+	 */
+	private TimeZone timeZone = TimeZone.getTimeZone("UTC");
+
+	/**
+	 * Defines if all fields need to be checked for NULL first.
+	 */
+	private Boolean nullCheck = true;
+
+	/**
+	 * Defines the configuration of Planner for Table API and SQL queries.
+	 */
+	private PlannerConfig plannerConfig = null;
+
+	/**
+	 * Defines the default context for decimal division calculation.
+	 * We use Scala's default MathContext.DECIMAL128.
+	 */
+	private MathContext decimalContext = MathContext.DECIMAL128;
+
+	/**
+	 * Specifies a threshold where generated code will be split into sub-function calls. Java
has a
+	 * maximum method length of 64 KB. This setting allows for finer granularity if necessary.
+	 */
+	private Integer maxGeneratedCodeLength = 64000; // just an estimate
+
+	/**
+	 * Defines user-defined configuration.
+	 */
+	private Configuration userDefinedConfig = GlobalConfiguration.loadConfiguration();
+
+	/**
+	 * Returns the timezone for date/time/timestamp conversions.
+	 */
+	public TimeZone getTimeZone() {
+		return timeZone;
+	}
+
+	/**
+	 * Sets the timezone for date/time/timestamp conversions.
+	 */
+	public void setTimeZone(TimeZone timeZone) {
+		this.timeZone = Preconditions.checkNotNull(timeZone);
+	}
+
+	/**
+	 * Returns the NULL check. If enabled, all fields need to be checked for NULL first.
+	 */
+	public Boolean getNullCheck() {
+		return nullCheck;
+	}
+
+	/**
+	 * Sets the NULL check. If enabled, all fields need to be checked for NULL first.
+	 */
+	public void setNullCheck(Boolean nullCheck) {
+		this.nullCheck = Preconditions.checkNotNull(nullCheck);
+	}
+
+	/**
+	 * Returns the current configuration of Planner for Table API and SQL queries.
+	 */
+	public Optional<PlannerConfig> getPlannerConfig() {
 
 Review comment:
   Good idea!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message