You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2019/07/22 11:48:51 UTC

[flink] branch master updated (c75af84 -> 7ba2298)

This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from c75af84  [FLINK-13326] Support async rawState checkpointing
     new e504957  [FLINK-13266] [table] move ExpressionParserException & UnresolvedException to table-common module
     new 7ba2298  [FLINK-13266] [table] remove definedTimeAttributes file in blink planner

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../flink/table/api/ExpressionParserException.java | 11 ++-
 .../flink/table/api/UnresolvedException.java       | 12 ++-
 .../table/api/ExpressionParserException.scala      | 60 --------------
 .../expressions/PlannerExpressionParserImpl.scala  |  2 +-
 .../apache/flink/table/expressions/composite.scala |  2 +-
 .../flink/table/expressions/fieldExpression.scala  | 12 +--
 .../table/sources/definedTimeAttributes.scala      | 95 ----------------------
 .../org/apache/flink/table/api/exceptions.scala    | 10 ---
 .../expressions/PlannerExpressionParserImpl.scala  |  2 +-
 .../apache/flink/table/expressions/composite.scala |  2 +-
 .../flink/table/expressions/fieldExpression.scala  | 12 +--
 11 files changed, 26 insertions(+), 194 deletions(-)
 copy flink-filesystems/flink-azure-fs-hadoop/src/main/java/org/apache/flink/fs/azurefs/SecureAzureFSFactory.java => flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/ExpressionParserException.java (78%)
 copy flink-filesystems/flink-azure-fs-hadoop/src/main/java/org/apache/flink/fs/azurefs/SecureAzureFSFactory.java => flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/UnresolvedException.java (78%)
 delete mode 100644 flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/ExpressionParserException.scala
 delete mode 100644 flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/definedTimeAttributes.scala


[flink] 02/02: [FLINK-13266] [table] remove definedTimeAttributes file in blink planner

Posted by tw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 7ba22989f46444754f736ad3ef337736d5b2a9c4
Author: godfreyhe <go...@163.com>
AuthorDate: Wed Jul 17 20:13:56 2019 +0800

    [FLINK-13266] [table] remove definedTimeAttributes file in blink planner
    
    those classes are already in table-common module
---
 .../table/sources/definedTimeAttributes.scala      | 95 ----------------------
 1 file changed, 95 deletions(-)

diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/definedTimeAttributes.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/definedTimeAttributes.scala
deleted file mode 100644
index b144312..0000000
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/definedTimeAttributes.scala
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.sources
-
-import java.util
-import java.util.Objects
-import javax.annotation.Nullable
-
-import org.apache.flink.table.api.TableSchema
-import org.apache.flink.table.api.Types
-import org.apache.flink.table.sources.tsextractors.TimestampExtractor
-import org.apache.flink.table.sources.wmstrategies.WatermarkStrategy
-
-/**
-  * Extends a [[TableSource]] to specify a processing time attribute.
-  */
-trait DefinedProctimeAttribute {
-
-  /**
-    * Returns the name of a processing time attribute or null if no processing time attribute is
-    * present.
-    *
-    * The referenced attribute must be present in the [[TableSchema]] of the [[TableSource]] and of
-    * type [[Types.SQL_TIMESTAMP]].
-    */
-  @Nullable
-  def getProctimeAttribute: String
-}
-
-/**
-  * Extends a [[TableSource]] to specify rowtime attributes via a
-  * [[RowtimeAttributeDescriptor]].
-  */
-trait DefinedRowtimeAttributes {
-
-  /**
-    * Returns a list of [[RowtimeAttributeDescriptor]] for all rowtime attributes of the table.
-    *
-    * All referenced attributes must be present in the [[TableSchema]] of the [[TableSource]] and of
-    * type [[Types.SQL_TIMESTAMP]].
-    *
-    * @return A list of [[RowtimeAttributeDescriptor]].
-    */
-  def getRowtimeAttributeDescriptors: util.List[RowtimeAttributeDescriptor]
-}
-
-/**
-  * Describes a rowtime attribute of a [[TableSource]].
-  *
-  * @param attributeName The name of the rowtime attribute.
-  * @param timestampExtractor The timestamp extractor to derive the values of the attribute.
-  * @param watermarkStrategy The watermark strategy associated with the attribute.
-  */
-class RowtimeAttributeDescriptor(
-  val attributeName: String,
-  val timestampExtractor: TimestampExtractor,
-  val watermarkStrategy: WatermarkStrategy) {
-
-  /** Returns the name of the rowtime attribute. */
-  def getAttributeName: String = attributeName
-
-  /** Returns the [[TimestampExtractor]] for the attribute. */
-  def getTimestampExtractor: TimestampExtractor = timestampExtractor
-
-  /** Returns the [[WatermarkStrategy]] for the attribute. */
-  def getWatermarkStrategy: WatermarkStrategy = watermarkStrategy
-
-  override def equals(other: Any): Boolean = other match {
-    case that: RowtimeAttributeDescriptor =>
-        Objects.equals(attributeName, that.attributeName) &&
-        Objects.equals(timestampExtractor, that.timestampExtractor) &&
-        Objects.equals(watermarkStrategy, that.watermarkStrategy)
-    case _ => false
-  }
-
-  override def hashCode(): Int = {
-    Objects.hash(attributeName, timestampExtractor, watermarkStrategy)
-  }
-}


[flink] 01/02: [FLINK-13266] [table] move ExpressionParserException & UnresolvedException to table-common module

Posted by tw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit e504957ca359fbc62004b4bd1386640254780a36
Author: godfreyhe <go...@163.com>
AuthorDate: Wed Jul 17 20:08:01 2019 +0800

    [FLINK-13266] [table] move ExpressionParserException & UnresolvedException to table-common module
---
 .../flink/table/api/ExpressionParserException.java | 29 +++++++++++
 .../flink/table/api/UnresolvedException.java       | 28 ++++++++++
 .../table/api/ExpressionParserException.scala      | 60 ----------------------
 .../expressions/PlannerExpressionParserImpl.scala  |  2 +-
 .../apache/flink/table/expressions/composite.scala |  2 +-
 .../flink/table/expressions/fieldExpression.scala  | 12 ++---
 .../org/apache/flink/table/api/exceptions.scala    | 10 ----
 .../expressions/PlannerExpressionParserImpl.scala  |  2 +-
 .../apache/flink/table/expressions/composite.scala |  2 +-
 .../flink/table/expressions/fieldExpression.scala  | 12 ++---
 10 files changed, 73 insertions(+), 86 deletions(-)

diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/ExpressionParserException.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/ExpressionParserException.java
new file mode 100644
index 0000000..89595ab
--- /dev/null
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/ExpressionParserException.java
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+/**
+ * Exception for all errors occurring during expression parsing.
+ */
+public class ExpressionParserException extends RuntimeException {
+
+	public ExpressionParserException(String msg) {
+		super(msg);
+	}
+}
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/UnresolvedException.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/UnresolvedException.java
new file mode 100644
index 0000000..4f7454c
--- /dev/null
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/UnresolvedException.java
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+/**
+ * Exception for unwanted method calling on unresolved expression.
+ */
+public class UnresolvedException extends RuntimeException {
+	public UnresolvedException(String msg) {
+		super(msg);
+	}
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/ExpressionParserException.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/ExpressionParserException.scala
deleted file mode 100644
index 91283bf..0000000
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/ExpressionParserException.scala
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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
-
-/**
-  * Exception for all errors occurring during expression parsing.
-  */
-case class ExpressionParserException(msg: String) extends RuntimeException(msg)
-
-/**
-  * Exception for unwanted method calling on unresolved expression.
-  */
-case class UnresolvedException(msg: String) extends RuntimeException(msg)
-
-/**
-  * Exception for adding an already existent table
-  *
-  * @param catalog    catalog name
-  * @param table      table name
-  * @param cause      the cause
-  */
-case class TableAlreadyExistException(
-    catalog: String,
-    table: String,
-    cause: Throwable)
-    extends RuntimeException(s"Table $catalog.$table already exists.", cause) {
-
-  def this(catalog: String, table: String) = this(catalog, table, null)
-
-}
-
-/**
-  * Exception for adding an already existent catalog
-  *
-  * @param catalog catalog name
-  * @param cause the cause
-  */
-case class CatalogAlreadyExistException(
-    catalog: String,
-    cause: Throwable)
-    extends RuntimeException(s"Catalog $catalog already exists.", cause) {
-
-  def this(catalog: String) = this(catalog, null)
-}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala
index 9f71209..aba1fc4 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala
@@ -719,7 +719,7 @@ object PlannerExpressionParserImpl extends JavaTokenParsers
   private def throwError(msg: String, next: Input): Nothing = {
     val improvedMsg = msg.replace("string matching regex `\\z'", "End of expression")
 
-    throw ExpressionParserException(
+    throw new ExpressionParserException(
       s"""Could not parse expression at column ${next.pos.column}: $improvedMsg
         |${next.pos.longString}""".stripMargin)
   }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/composite.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/composite.scala
index 64a2f63..d9726e8 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/composite.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/composite.scala
@@ -32,7 +32,7 @@ case class Flattening(child: PlannerExpression) extends UnaryExpression {
   override def toString = s"$child.flatten()"
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException(s"Invalcall to on ${this.getClass}.")
+    throw new UnresolvedException(s"Invalcall to on ${this.getClass}.")
 
   override private[flink] def validateInput(): ValidationResult =
     ValidationFailure(s"Unresolved flattening of $child")
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala
index 6d19c8f..5da7e49 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala
@@ -59,7 +59,7 @@ case class UnresolvedFieldReference(name: String) extends Attribute {
     UnresolvedFieldReference(newName)
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException(s"Calling resultType on ${this.getClass}.")
+    throw new UnresolvedException(s"Calling resultType on ${this.getClass}.")
 
   override private[flink] def validateInput(): ValidationResult =
     ValidationFailure(s"Unresolved reference $name.")
@@ -112,13 +112,13 @@ case class Alias(child: PlannerExpression, name: String, extraNames: Seq[String]
 case class UnresolvedAlias(child: PlannerExpression) extends UnaryExpression with NamedExpression {
 
   override private[flink] def name: String =
-    throw UnresolvedException("Invalid call to name on UnresolvedAlias")
+    throw new UnresolvedException("Invalid call to name on UnresolvedAlias")
 
   override private[flink] def toAttribute: Attribute =
-    throw UnresolvedException("Invalid call to toAttribute on UnresolvedAlias")
+    throw new UnresolvedException("Invalid call to toAttribute on UnresolvedAlias")
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException("Invalid call to resultType on UnresolvedAlias")
+    throw new UnresolvedException("Invalid call to resultType on UnresolvedAlias")
 
   override private[flink] lazy val valid = false
 }
@@ -126,7 +126,7 @@ case class UnresolvedAlias(child: PlannerExpression) extends UnaryExpression wit
 case class WindowReference(name: String, tpe: Option[TypeInformation[_]] = None) extends Attribute {
 
   override private[flink] def resultType: TypeInformation[_] =
-    tpe.getOrElse(throw UnresolvedException("Could not resolve type of referenced window."))
+    tpe.getOrElse(throw new UnresolvedException("Could not resolve type of referenced window."))
 
   override private[flink] def withName(newName: String): Attribute = {
     if (newName == name) {
@@ -144,7 +144,7 @@ case class TableReference(name: String, tableOperation: QueryOperation)
   with NamedExpression {
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException(s"Table reference '$name' has no result type.")
+    throw new UnresolvedException(s"Table reference '$name' has no result type.")
 
   override private[flink] def toAttribute =
     throw new UnsupportedOperationException(s"A table reference '$name' can not be an attribute.")
diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/exceptions.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/exceptions.scala
index 91283bf..e355c6f 100644
--- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/exceptions.scala
+++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/exceptions.scala
@@ -19,16 +19,6 @@
 package org.apache.flink.table.api
 
 /**
-  * Exception for all errors occurring during expression parsing.
-  */
-case class ExpressionParserException(msg: String) extends RuntimeException(msg)
-
-/**
-  * Exception for unwanted method calling on unresolved expression.
-  */
-case class UnresolvedException(msg: String) extends RuntimeException(msg)
-
-/**
   * Exception for adding an already existent table
   *
   * @param catalog    catalog name
diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala
index 32161a3..895e3da 100644
--- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala
+++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala
@@ -721,7 +721,7 @@ object PlannerExpressionParserImpl extends JavaTokenParsers
   private def throwError(msg: String, next: Input): Nothing = {
     val improvedMsg = msg.replace("string matching regex `\\z'", "End of expression")
 
-    throw ExpressionParserException(
+    throw new ExpressionParserException(
       s"""Could not parse expression at column ${next.pos.column}: $improvedMsg
         |${next.pos.longString}""".stripMargin)
   }
diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/composite.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/composite.scala
index 3e2c374..40e7625 100644
--- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/composite.scala
+++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/composite.scala
@@ -34,7 +34,7 @@ case class Flattening(child: PlannerExpression) extends UnaryExpression {
   override def toString = s"$child.flatten()"
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException(s"Invalcall to on ${this.getClass}.")
+    throw new UnresolvedException(s"Invalcall to on ${this.getClass}.")
 
   override private[flink] def validateInput(): ValidationResult =
     ValidationFailure(s"Unresolved flattening of $child")
diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala
index ced9b32..4873bf6 100644
--- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala
+++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/fieldExpression.scala
@@ -63,7 +63,7 @@ case class UnresolvedFieldReference(name: String) extends Attribute {
     UnresolvedFieldReference(newName)
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException(s"Calling resultType on ${this.getClass}.")
+    throw new UnresolvedException(s"Calling resultType on ${this.getClass}.")
 
   override private[flink] def validateInput(): ValidationResult =
     ValidationFailure(s"Unresolved reference $name.")
@@ -124,13 +124,13 @@ case class Alias(child: PlannerExpression, name: String, extraNames: Seq[String]
 case class UnresolvedAlias(child: PlannerExpression) extends UnaryExpression with NamedExpression {
 
   override private[flink] def name: String =
-    throw UnresolvedException("Invalid call to name on UnresolvedAlias")
+    throw new UnresolvedException("Invalid call to name on UnresolvedAlias")
 
   override private[flink] def toAttribute: Attribute =
-    throw UnresolvedException("Invalid call to toAttribute on UnresolvedAlias")
+    throw new UnresolvedException("Invalid call to toAttribute on UnresolvedAlias")
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException("Invalid call to resultType on UnresolvedAlias")
+    throw new UnresolvedException("Invalid call to resultType on UnresolvedAlias")
 
   override private[flink] lazy val valid = false
 }
@@ -141,7 +141,7 @@ case class WindowReference(name: String, tpe: Option[TypeInformation[_]] = None)
     throw new UnsupportedOperationException("A window reference can not be used solely.")
 
   override private[flink] def resultType: TypeInformation[_] =
-    tpe.getOrElse(throw UnresolvedException("Could not resolve type of referenced window."))
+    tpe.getOrElse(throw new UnresolvedException("Could not resolve type of referenced window."))
 
   override private[flink] def withName(newName: String): Attribute = {
     if (newName == name) {
@@ -162,7 +162,7 @@ case class TableReference(name: String, tableOperation: QueryOperation)
     throw new UnsupportedOperationException(s"Table reference '$name' can not be used solely.")
 
   override private[flink] def resultType: TypeInformation[_] =
-    throw UnresolvedException(s"Table reference '$name' has no result type.")
+    throw new UnresolvedException(s"Table reference '$name' has no result type.")
 
   override private[flink] def toAttribute =
     throw new UnsupportedOperationException(s"A table reference '$name' can not be an attribute.")