[
https://issues.apache.org/jira/browse/BEAM-2953?focusedWorklogId=155658&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-155658
]
ASF GitHub Bot logged work on BEAM-2953:
----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Oct/18 00:16
Start Date: 18/Oct/18 00:16
Worklog Time Spent: 10m
Work Description: akedin commented on a change in pull request #6540:
[BEAM-2953] Advanced Timeseries examples.
URL: https://github.com/apache/beam/pull/6540#discussion_r226135037
##########
File path:
sdks/java/extensions/timeseries/src/main/java/org/apache/beam/sdk/extensions/timeseries/io/tf/TFExampleToBytes.java
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.beam.sdk.extensions.timeseries.io.tf;
+
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.tensorflow.example.Example;
+
+/** Convert TensorFlow Example object to byte[]. */
+@Experimental
+public class TFExampleToBytes extends DoFn<Example, byte[]> {
Review comment:
Can you share an example where you use these `TFExample*` `DoFns`? Beam
elements are all technically byte arrays, and Beam has Coders to serialize and
deserialize elements to/from bytes. And ultimately the IOs should understand
how to do that. If these were some custom classes for which you needed to
implement custom serialization for then it would probably make sense to
implement custom coders. But these specific classes are subclasses of protobuf
messages, which Beam should have good support for (e.g. there's `ProtoCoder`
([link](https://github.com/apache/beam/blob/279a05604b83a54e8e5a79e13d8761f94841f326/sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoCoder.java))
that's used in GCP IOs, and there's `CoderUtils`
[stuff](https://github.com/apache/beam/blob/279a05604b83a54e8e5a79e13d8761f94841f326/sdks/java/core/src/main/java/org/apache/beam/sdk/util/CoderUtils.java#L50)
that can probably be used in conjunction). So my intuition is that it should
be possible to use some generic solution that already exists in Beam to
implement byte conversion, instead of creating custom classes for specific use
case. Maybe I'm wrong here, and usage examples (and/or tests) would help
understand this part
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 155658)
Time Spent: 3h 40m (was: 3.5h)
> Timeseries processing extensions using state API
> ------------------------------------------------
>
> Key: BEAM-2953
> URL: https://issues.apache.org/jira/browse/BEAM-2953
> Project: Beam
> Issue Type: Improvement
> Components: sdk-ideas
> Affects Versions: 2.7.0
> Reporter: Reza ardeshir rokni
> Assignee: Reuven Lax
> Priority: Minor
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> A general set of timeseries transforms that abstract the user from the
> process of dealing with some of the common problems when dealing with
> timeseries using BEAM (in stream or batch mode).
> BEAM can be used to build out some very interesting pre-processing stages for
> time series data. Some examples that will be useful:
> - Downsampling time series based on simple MIN, MAX, COUNT, SUM, LAST, FIRST
> - Creating a value for each downsampled window even if no value has been
> emitted for the specific key.
> - Loading the value of a downsample with the previous value (used in FX with
> previous close being brought into current open value)
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)