[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376693&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376693
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 02:14
Start Date: 24/Jan/20 02:14
Worklog Time Spent: 10m 
  Work Description: TheNeuralBit commented on pull request #10681: 
[BEAM-9072] [SQL] Primitive types should fall through
URL: https://github.com/apache/beam/pull/10681
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376693)
Time Spent: 7h 40m  (was: 7.5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
> Fix For: 2.20.0
>
>  Time Spent: 7h 40m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376683&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376683
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 01:20
Start Date: 24/Jan/20 01:20
Worklog Time Spent: 10m 
  Work Description: TheNeuralBit commented on issue #10681: [BEAM-9072] 
[SQL] Primitive types should fall through
URL: https://github.com/apache/beam/pull/10681#issuecomment-577952933
 
 
   retest this please
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376683)
Time Spent: 7.5h  (was: 7h 20m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
> Fix For: 2.20.0
>
>  Time Spent: 7.5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376681&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376681
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 01:20
Start Date: 24/Jan/20 01:20
Worklog Time Spent: 10m 
  Work Description: TheNeuralBit commented on issue #10681: [BEAM-9072] 
[SQL] Primitive types should fall through
URL: https://github.com/apache/beam/pull/10681#issuecomment-577952865
 
 
   Run SQL PostCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376681)
Time Spent: 7h 20m  (was: 7h 10m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
> Fix For: 2.20.0
>
>  Time Spent: 7h 20m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376679&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376679
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 01:11
Start Date: 24/Jan/20 01:11
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r370434537
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/schema/BeamTableUtils.java
 ##
 @@ -137,6 +138,12 @@ public static Object autoCastField(Schema.Field field, 
Object rawObj) {
   throw new UnsupportedOperationException(
   String.format("Column type %s is not supported yet!", type));
   }
+} else if (type.getTypeName().isPrimitiveType()) {
+  if (TypeName.BYTES.equals(type.getTypeName()) && rawObj instanceof 
ByteString) {
+return ((ByteString) rawObj).getBytes();
+  }
+  throw new UnsupportedOperationException(
+  String.format("Column type %s is not supported yet!", type));
 
 Review comment:
   Created a PR #10681, which removes this exception.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376679)
Time Spent: 7h 10m  (was: 7h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
> Fix For: 2.20.0
>
>  Time Spent: 7h 10m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376678&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376678
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 01:10
Start Date: 24/Jan/20 01:10
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10681: [BEAM-9072] 
[SQL] Primitive types should fall through
URL: https://github.com/apache/beam/pull/10681
 
 
   `PubsubJsonIT` is failing due to this exception, introduced in #10544.
   R: @TheNeuralBit 
   
   
   
   Thank you for your contribution! Follow this checklist to help us 
incorporate your contribution quickly and easily:
   
- [ ] [**Choose 
reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and 
mention them in a comment (`R: @username`).
- [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA 
issue, if applicable. This will automatically link the pull request to the 
issue.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more 
tips on [how to make review process 
smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
   
   Post-Commit Tests Status (on master branch)
   

   
   Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
   --- | --- | --- | --- | --- | --- | --- | ---
   Go | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/)
 | --- | --- | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/)
 | --- | --- | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/)
   Java | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)[![Build
 
Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)[![Build
 
Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)[![Build
 
Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)[![Build
 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/)
   Python | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)[![Build
 
Status](ht

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376674&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376674
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 00:56
Start Date: 24/Jan/20 00:56
Worklog Time Spent: 10m 
  Work Description: TheNeuralBit commented on pull request #10440: 
[BEAM-9072] [SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r370431157
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/schema/BeamTableUtils.java
 ##
 @@ -137,6 +138,12 @@ public static Object autoCastField(Schema.Field field, 
Object rawObj) {
   throw new UnsupportedOperationException(
   String.format("Column type %s is not supported yet!", type));
   }
+} else if (type.getTypeName().isPrimitiveType()) {
+  if (TypeName.BYTES.equals(type.getTypeName()) && rawObj instanceof 
ByteString) {
+return ((ByteString) rawObj).getBytes();
+  }
+  throw new UnsupportedOperationException(
+  String.format("Column type %s is not supported yet!", type));
 
 Review comment:
   Seems like an easy fix is definitely possible. Just need to add a BOOLEAN 
case, or remove this UnsupportedOperationException and let it (and other 
non-numeric primitive types) fall through.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376674)
Time Spent: 6h 50m  (was: 6h 40m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
> Fix For: 2.20.0
>
>  Time Spent: 6h 50m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376668&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376668
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 24/Jan/20 00:48
Start Date: 24/Jan/20 00:48
Worklog Time Spent: 10m 
  Work Description: TheNeuralBit commented on pull request #10440: 
[BEAM-9072] [SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r370429316
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/schema/BeamTableUtils.java
 ##
 @@ -137,6 +138,12 @@ public static Object autoCastField(Schema.Field field, 
Object rawObj) {
   throw new UnsupportedOperationException(
   String.format("Column type %s is not supported yet!", type));
   }
+} else if (type.getTypeName().isPrimitiveType()) {
+  if (TypeName.BYTES.equals(type.getTypeName()) && rawObj instanceof 
ByteString) {
+return ((ByteString) rawObj).getBytes();
+  }
+  throw new UnsupportedOperationException(
+  String.format("Column type %s is not supported yet!", type));
 
 Review comment:
   @11moon11 it looks like this broke PubsubJsonIT: 
https://builds.apache.org/job/beam_PostCommit_SQL/3812
   
   ```
   java.lang.UnsupportedOperationException: Column type 
FieldType{typeName=BOOLEAN, nullable=true, logicalType=null, 
collectionElementType=null, mapKeyType=null, mapValueType=null, rowSchema=null, 
metadata={}} is not supported yet!
at 
org.apache.beam.sdk.extensions.sql.impl.schema.BeamTableUtils.autoCastField(BeamTableUtils.java:146)
at 
org.apache.beam.sdk.extensions.sql.impl.rel.BeamValuesRel.lambda$tupleToRow$0(BeamValuesRel.java:95)
at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:250)
   ```
   
   Do you think it would be easy to fix or should we roll back?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376668)
Time Spent: 6h 40m  (was: 6.5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
> Fix For: 2.20.0
>
>  Time Spent: 6h 40m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376567&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376567
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 23/Jan/20 21:20
Start Date: 23/Jan/20 21:20
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376567)
Time Spent: 6.5h  (was: 6h 20m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 6.5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=376434&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376434
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 23/Jan/20 18:54
Start Date: 23/Jan/20 18:54
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-577822727
 
 
   Run Java PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 376434)
Time Spent: 6h 20m  (was: 6h 10m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 6h 20m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375303&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375303
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 23:46
Start Date: 21/Jan/20 23:46
Worklog Time Spent: 10m 
  Work Description: amaliujia commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576940136
 
 
   Run JavaBeamZetaSQL PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375303)
Time Spent: 6h 10m  (was: 6h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 6h 10m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375302&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375302
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 23:46
Start Date: 21/Jan/20 23:46
Worklog Time Spent: 10m 
  Work Description: amaliujia commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576940105
 
 
   Run SQL postcommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375302)
Time Spent: 6h  (was: 5h 50m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 6h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375211&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375211
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 21:02
Start Date: 21/Jan/20 21:02
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576868737
 
 
   `Java PreCommit` ran twice:
   - https://builds.apache.org/job/beam_PreCommit_Java_Phrase/1664/ (passed)
   - https://builds.apache.org/job/beam_PreCommit_Java_Phrase/1665/ (failed 
with a timeout)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375211)
Time Spent: 5h 50m  (was: 5h 40m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375200&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375200
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 20:34
Start Date: 21/Jan/20 20:34
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576868737
 
 
   PreCommit ran twice:
   - https://builds.apache.org/job/beam_PreCommit_Java_Phrase/1664/ (passed)
   - https://builds.apache.org/job/beam_PreCommit_Java_Phrase/1665/ (failed 
with a timeout)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375200)
Time Spent: 5h 40m  (was: 5.5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 5h 40m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375182&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375182
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 19:33
Start Date: 21/Jan/20 19:33
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576843057
 
 
   Run Java PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375182)
Time Spent: 5h 20m  (was: 5h 10m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 5h 20m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375181&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375181
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 19:33
Start Date: 21/Jan/20 19:33
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576843003
 
 
   Run JavaPortabilityApi PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375181)
Time Spent: 5h 10m  (was: 5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=375184&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-375184
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 21/Jan/20 19:33
Start Date: 21/Jan/20 19:33
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576843206
 
 
   Run Java PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 375184)
Time Spent: 5.5h  (was: 5h 20m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=374730&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-374730
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 20/Jan/20 22:13
Start Date: 20/Jan/20 22:13
Worklog Time Spent: 10m 
  Work Description: iemejia commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-576445504
 
 
   retest this please
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 374730)
Time Spent: 5h  (was: 4h 50m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373964&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373964
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 18/Jan/20 00:11
Start Date: 18/Jan/20 00:11
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575842055
 
 
   Run JavaPortabilityApi PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373964)
Time Spent: 4h 50m  (was: 4h 40m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373954&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373954
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 17/Jan/20 23:54
Start Date: 17/Jan/20 23:54
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575838697
 
 
   Run JavaPortabilityApi PreCommit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373954)
Time Spent: 4h 40m  (was: 4.5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373952&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373952
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 17/Jan/20 23:49
Start Date: 17/Jan/20 23:49
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575837709
 
 
   JavaPortabilityApi failed with:
   ```
   Execution failed for task 
':runners:google-cloud-dataflow-java:buildAndPushDockerContainer'.
   Process 'command 'docker'' finished with non-zero exit value 1
   ```
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373952)
Time Spent: 4.5h  (was: 4h 20m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373942&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373942
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 17/Jan/20 23:26
Start Date: 17/Jan/20 23:26
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575833263
 
 
   retest this please
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373942)
Time Spent: 4h 20m  (was: 4h 10m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373287&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373287
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 22:28
Start Date: 16/Jan/20 22:28
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575376707
 
 
   Tests are running, but looks like GitHub UI did not catch that, links:
   - 
[beam_PreCommit_Java_Commit](https://builds.apache.org/view/A-D/view/Beam/view/All/job/beam_PreCommit_Java_Commit/9667/)
   - 
[beam_PreCommit_JavaBeamZetaSQL_Commit](https://builds.apache.org/view/A-D/view/Beam/view/All/job/beam_PreCommit_JavaBeamZetaSQL_Commit/882/)
   - 
[beam_PreCommit_SQL_Commit](https://builds.apache.org/view/A-D/view/Beam/view/All/job/beam_PreCommit_SQL_Commit/444/)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373287)
Time Spent: 4h 10m  (was: 4h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373281&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373281
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 22:22
Start Date: 16/Jan/20 22:22
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575374615
 
 
   retest this please
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373281)
Time Spent: 4h  (was: 3h 50m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373220&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373220
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 19:20
Start Date: 16/Jan/20 19:20
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-575303386
 
 
   retest this please
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373220)
Time Spent: 3h 50m  (was: 3h 40m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=373213&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-373213
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 19:02
Start Date: 16/Jan/20 19:02
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-574927857
 
 
   TODO:
   - [x] Add tests for both read and write that don't rely on SQL.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 373213)
Time Spent: 3h 40m  (was: 3.5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372684&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372684
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:53
Start Date: 16/Jan/20 00:53
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-574927857
 
 
   TODO:
   - [ ] Add tests for both read and write that don't rely on SQL.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 372684)
Time Spent: 3.5h  (was: 3h 20m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372681&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372681
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182671
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372680&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372680
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182658
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372676&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372676
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182617
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,483 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Internal
+@Experimental
+class DataStoreV1Table extends SchemaBaseBeamTable implements Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should mat

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372678&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372678
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182642
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,483 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Internal
+@Experimental
+class DataStoreV1Table extends SchemaBaseBeamTable implements Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should mat

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372677&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372677
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182629
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreReadWriteIT.java
 ##
 @@ -0,0 +1,185 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static 
org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils.VARBINARY;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.BOOLEAN;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.DATETIME;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.DOUBLE;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.INT64;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.STRING;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+
+import com.google.datastore.v1.Key;
+import java.util.UUID;
+import org.apache.beam.sdk.PipelineResult;
+import org.apache.beam.sdk.PipelineResult.State;
+import org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv;
+import org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils;
+import org.apache.beam.sdk.io.gcp.bigquery.BigQueryOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.avatica.util.ByteString;
+import org.joda.time.Duration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class DataStoreReadWriteIT {
+  private static final BigQueryOptions options =
+  TestPipeline.testingPipelineOptions().as(BigQueryOptions.class);
+  private static final Schema SOURCE_SCHEMA =
+  Schema.builder()
+  .addNullableField("__key__", VARBINARY)
+  .addNullableField("content", STRING)
+  .build();
+  private static final Schema SOURCE_SCHEMA_WITHOUT_KEY =
+  Schema.builder().addNullableField("content", STRING).build();
+  private static final String KIND = "writereadtest";
+  private static final String KIND_ALL_TYPES = "writereadalltypestest";
+
+  @Rule public final TestPipeline writePipeline = TestPipeline.create();
+  @Rule public transient TestPipeline readPipeline = TestPipeline.create();
+
+  @Test
+  public void testDataStoreV1SqlWriteRead() {
+BeamSqlEnv sqlEnv = BeamSqlEnv.inMemory(new DataStoreV1TableProvider());
+String projectId = options.getProject();
+
+String createTableStatement =
+"CREATE EXTERNAL TABLE TEST( \n"
++ "   `__key__` VARBINARY, \n"
++ "   `content` VARCHAR \n"
++ ") \n"
++ "TYPE 'datastoreV1' \n"
++ "LOCATION '"
++ projectId
++ "/"
++ KIND
++ "'";
+sqlEnv.executeDdl(createTableStatement);
+
+Key ancestor = makeKey(KIND, UUID.randomUUID().toString()).build();
+Key itemKey = makeKey(ancestor, KIND, 
UUID.randomUUID().toString()).build();
+String insertStatement =
+"INSERT INTO TEST VALUES ( \n" + keyToSqlByteString(itemKey) + ", \n" 
+ "'2000' \n" + ")";
+
+BeamSqlRelUtils.toPCollection(writePipeline, 
sqlEnv.parseQuery(insertStatement));
+writePipeline.run().waitUntilFinish();
+
+String selectTableStatement = "SELECT * FROM TEST";
+PCollection output =
+BeamSqlRelUtils.toPCollection(readPipeline, 
sqlE

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372679&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372679
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182652
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372682&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372682
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182690
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372683&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372683
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 16/Jan/20 00:52
Start Date: 16/Jan/20 00:52
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367182702
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372638&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372638
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:33
Start Date: 15/Jan/20 23:33
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367159861
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,483 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Internal
+@Experimental
+class DataStoreV1Table extends SchemaBaseBeamTable implements Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should mat

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372636&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372636
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:33
Start Date: 15/Jan/20 23:33
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367160921
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreReadWriteIT.java
 ##
 @@ -0,0 +1,185 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static 
org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils.VARBINARY;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.BOOLEAN;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.DATETIME;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.DOUBLE;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.INT64;
+import static org.apache.beam.sdk.schemas.Schema.FieldType.STRING;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+
+import com.google.datastore.v1.Key;
+import java.util.UUID;
+import org.apache.beam.sdk.PipelineResult;
+import org.apache.beam.sdk.PipelineResult.State;
+import org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv;
+import org.apache.beam.sdk.extensions.sql.impl.rel.BeamSqlRelUtils;
+import org.apache.beam.sdk.io.gcp.bigquery.BigQueryOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.avatica.util.ByteString;
+import org.joda.time.Duration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class DataStoreReadWriteIT {
+  private static final BigQueryOptions options =
+  TestPipeline.testingPipelineOptions().as(BigQueryOptions.class);
+  private static final Schema SOURCE_SCHEMA =
+  Schema.builder()
+  .addNullableField("__key__", VARBINARY)
+  .addNullableField("content", STRING)
+  .build();
+  private static final Schema SOURCE_SCHEMA_WITHOUT_KEY =
+  Schema.builder().addNullableField("content", STRING).build();
+  private static final String KIND = "writereadtest";
+  private static final String KIND_ALL_TYPES = "writereadalltypestest";
+
+  @Rule public final TestPipeline writePipeline = TestPipeline.create();
+  @Rule public transient TestPipeline readPipeline = TestPipeline.create();
+
+  @Test
+  public void testDataStoreV1SqlWriteRead() {
+BeamSqlEnv sqlEnv = BeamSqlEnv.inMemory(new DataStoreV1TableProvider());
+String projectId = options.getProject();
+
+String createTableStatement =
+"CREATE EXTERNAL TABLE TEST( \n"
++ "   `__key__` VARBINARY, \n"
++ "   `content` VARCHAR \n"
++ ") \n"
++ "TYPE 'datastoreV1' \n"
++ "LOCATION '"
++ projectId
++ "/"
++ KIND
++ "'";
+sqlEnv.executeDdl(createTableStatement);
+
+Key ancestor = makeKey(KIND, UUID.randomUUID().toString()).build();
+Key itemKey = makeKey(ancestor, KIND, 
UUID.randomUUID().toString()).build();
+String insertStatement =
+"INSERT INTO TEST VALUES ( \n" + keyToSqlByteString(itemKey) + ", \n" 
+ "'2000' \n" + ")";
+
+BeamSqlRelUtils.toPCollection(writePipeline, 
sqlEnv.parseQuery(insertStatement));
+writePipeline.run().waitUntilFinish();
+
+String selectTableStatement = "SELECT * FROM TEST";
+PCollection output =
+BeamSqlRelUtils.toPCollection(readPipeline, 
sqlE

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372637&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372637
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:33
Start Date: 15/Jan/20 23:33
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367162017
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,483 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Internal;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Internal
+@Experimental
+class DataStoreV1Table extends SchemaBaseBeamTable implements Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should mat

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372626&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372626
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:23
Start Date: 15/Jan/20 23:23
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367153928
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372630&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372630
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:23
Start Date: 15/Jan/20 23:23
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367158445
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372629&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372629
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:23
Start Date: 15/Jan/20 23:23
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367158059
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372628&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372628
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:23
Start Date: 15/Jan/20 23:23
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367156880
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372627&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372627
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 23:23
Start Date: 15/Jan/20 23:23
Worklog Time Spent: 10m 
  Work Description: apilloud commented on pull request #10440: [BEAM-9072] 
[SQL] DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#discussion_r367157041
 
 

 ##
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datastore/DataStoreV1Table.java
 ##
 @@ -0,0 +1,479 @@
+/*
+ * 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.sql.meta.provider.datastore;
+
+import static com.google.datastore.v1.Value.ValueTypeCase.ARRAY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BLOB_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.BOOLEAN_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.DOUBLE_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.ENTITY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.INTEGER_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.KEY_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.NULL_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.STRING_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.TIMESTAMP_VALUE;
+import static com.google.datastore.v1.Value.ValueTypeCase.VALUETYPE_NOT_SET;
+import static com.google.datastore.v1.client.DatastoreHelper.makeKey;
+import static com.google.datastore.v1.client.DatastoreHelper.makeValue;
+import static 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ImmutableMap;
+import com.google.datastore.v1.Entity;
+import com.google.datastore.v1.Key;
+import com.google.datastore.v1.Query;
+import com.google.datastore.v1.Value;
+import com.google.datastore.v1.Value.ValueTypeCase;
+import com.google.protobuf.ByteString;
+import com.google.protobuf.InvalidProtocolBufferException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics;
+import org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable;
+import org.apache.beam.sdk.extensions.sql.meta.Table;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
+import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.FieldType;
+import org.apache.beam.sdk.schemas.Schema.TypeName;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PBegin;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollection.IsBounded;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.Row;
+import 
org.apache.beam.vendor.calcite.v1_20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import org.joda.time.Instant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataStoreV1Table extends SchemaBaseBeamTable implements 
Serializable {
+  public static final String KEY_FIELD_PROPERTY = "keyField";
+  @VisibleForTesting static final String DEFAULT_KEY_FIELD = "__key__";
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(DataStoreV1Table.class);
+  // Should match: `projectId/kind`.
+  private static final Pattern locationPattern = 
Pattern.compile("(?.+)/(?.+)");
+  @VisibleForTes

[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372452&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372452
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 18:10
Start Date: 15/Jan/20 18:10
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-568088283
 
 
   CC: @TheNeuralBit
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 372452)
Time Spent: 1h  (was: 50m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-14 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=372038&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372038
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 15/Jan/20 00:32
Start Date: 15/Jan/20 00:32
Worklog Time Spent: 10m 
  Work Description: 11moon11 commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-574439932
 
 
   R: @apilloud 
   CC: @TheNeuralBit 
   CC: @amaliujia 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 372038)
Time Spent: 50m  (was: 40m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics
> Doc: 
> [https://docs.google.com/document/d/1FxuEGewJ3GPDl0IKglfOYf1edwa2m_wryFZYRMpRNbA/edit?pli=1]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=370010&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-370010
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 10/Jan/20 19:10
Start Date: 10/Jan/20 19:10
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-573166837
 
 
   This looks interesting. I wonder why tests aren't running.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 370010)
Time Spent: 40m  (was: 0.5h)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=370009&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-370009
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 10/Jan/20 19:09
Start Date: 10/Jan/20 19:09
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-573166837
 
 
   This looks interesting. I wonder why tests aren't running.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 370009)
Time Spent: 0.5h  (was: 20m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=370006&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-370006
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 10/Jan/20 19:09
Start Date: 10/Jan/20 19:09
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-573166393
 
 
   (!)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 370006)
Time Spent: 20m  (was: 10m)

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (BEAM-9072) [SQL] Add support for Datastore source

2020-01-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/BEAM-9072?focusedWorklogId=370005&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-370005
 ]

ASF GitHub Bot logged work on BEAM-9072:


Author: ASF GitHub Bot
Created on: 10/Jan/20 19:08
Start Date: 10/Jan/20 19:08
Worklog Time Spent: 10m 
  Work Description: apilloud commented on issue #10440: [BEAM-9072] [SQL] 
DataStoreV1 IO connector
URL: https://github.com/apache/beam/pull/10440#issuecomment-573166393
 
 
   (!)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 370005)
Remaining Estimate: 0h
Time Spent: 10m

> [SQL] Add support for Datastore source
> --
>
> Key: BEAM-9072
> URL: https://issues.apache.org/jira/browse/BEAM-9072
> Project: Beam
>  Issue Type: New Feature
>  Components: dsl-sql
>Reporter: Kirill Kozlov
>Assignee: Kirill Kozlov
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> * Create a Datastore table and table provider
>  * Conversion between Datastore and Beam data types
>  * Implement buildIOReader
>  * Implement buildIOWrite
>  * Implement getTableStatistics



--
This message was sent by Atlassian Jira
(v8.3.4#803005)