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 2018/07/26 07:49:32 UTC
[flink] branch release-1.6 updated: [hotfix] [table] Remove wrong
ISO references for timestamp extraction
This is an automated email from the ASF dual-hosted git repository.
twalthr pushed a commit to branch release-1.6
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.6 by this push:
new 20802bd [hotfix] [table] Remove wrong ISO references for timestamp extraction
20802bd is described below
commit 20802bd0eb0d537cd3dd5913ccef4c7584e798eb
Author: Timo Walther <tw...@apache.org>
AuthorDate: Thu Jul 26 09:07:11 2018 +0200
[hotfix] [table] Remove wrong ISO references for timestamp extraction
The docs and timestamp extractors mention ISO timestamps, however, according
to ISO 8601 timestamps have a different format.
---
docs/dev/table/sourceSinks.md | 3 +--
.../flink/table/sources/tsextractors/ExistingField.scala | 10 ++++++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/docs/dev/table/sourceSinks.md b/docs/dev/table/sourceSinks.md
index 4c5f2e2..3c2152b 100644
--- a/docs/dev/table/sourceSinks.md
+++ b/docs/dev/table/sourceSinks.md
@@ -460,8 +460,7 @@ val source: KafkaTableSource = Kafka010JsonTableSource.builder()
Flink provides `TimestampExtractor` implementations for common use cases.
The following `TimestampExtractor` implementations are currently available:
-* `ExistingField(fieldName)`: Extracts the value of a rowtime attribute from an existing `LONG` or `SQL_TIMESTAMP`, or ISO date formatted `STRING` field.
- * One example of ISO date format would be '2018-05-28 12:34:56.000'.
+* `ExistingField(fieldName)`: Extracts the value of a rowtime attribute from an existing `LONG`, `SQL_TIMESTAMP`, or timestamp formatted `STRING` field. One example of such a string would be '2018-05-28 12:34:56.000'.
* `StreamRecordTimestamp()`: Extracts the value of a rowtime attribute from the timestamp of the `DataStream` `StreamRecord`. Note, this `TimestampExtractor` is not available for batch table sources.
A custom `TimestampExtractor` can be defined by implementing the corresponding interface.
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala
index 9b091ee..979f869 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala
@@ -23,8 +23,9 @@ import org.apache.flink.table.api.{Types, ValidationException}
import org.apache.flink.table.expressions.{Cast, Expression, ResolvedFieldReference}
/**
- * Converts an existing [[Long]] or [[java.sql.Timestamp]], or
- * ISO date formatted [[java.lang.String]] field into a rowtime attribute.
+ * Converts an existing [[Long]], [[java.sql.Timestamp]], or
+ * timestamp formatted [[java.lang.String]] field (e.g., "2018-05-28 12:34:56.000") into
+ * a rowtime attribute.
*
* @param field The field to convert into a rowtime attribute.
*/
@@ -47,8 +48,9 @@ final class ExistingField(val field: String) extends TimestampExtractor {
}
/**
- * Returns an [[Expression]] that casts a [[Long]] or [[java.sql.Timestamp]], or
- * ISO date formatted [[java.lang.String]] field into a rowtime attribute.
+ * Returns an [[Expression]] that casts a [[Long]], [[java.sql.Timestamp]], or
+ * timestamp formatted [[java.lang.String]] field (e.g., "2018-05-28 12:34:56.000")
+ * into a rowtime attribute.
*/
override def getExpression(fieldAccesses: Array[ResolvedFieldReference]): Expression = {
val fieldAccess: Expression = fieldAccesses(0)