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

ASF GitHub Bot logged work on BEAM-12674:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Feb/22 14:08
            Start Date: 22/Feb/22 14:08
    Worklog Time Spent: 10m 
      Work Description: yeandy opened a new pull request #16916:
URL: https://github.com/apache/beam/pull/16916


   **Please** add a meaningful description for your change here
   
   ------------------------
   
   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.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] 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).
   
   To check the build health, please visit 
[https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/validate-runner/README.md)
   
   GitHub Actions Tests Status (on master branch)
   
------------------------------------------------------------------------------------------------
   [![Build python source distribution and 
wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python 
tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java 
tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more 
information about GitHub Actions CI.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

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

> SqlTransform IllegalArgumentException: key already present: SchemaCoder
> -----------------------------------------------------------------------
>
>                 Key: BEAM-12674
>                 URL: https://issues.apache.org/jira/browse/BEAM-12674
>             Project: Beam
>          Issue Type: Improvement
>          Components: cross-language, dsl-sql, sdk-py-core
>            Reporter: Ning
>            Assignee: Andy Ye
>            Priority: P3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When defining a SqlTransform joining two PCollections with the same Row 
> schema, the expansion service throws below exception:
> {code:java}
> RuntimeError: java.lang.IllegalArgumentException: key already present: 
> SchemaCoder<Schema: Fields:
> Field{name=number, description=, type=INT64 NOT NULL, options={{}}}
> Encoding positions:
> {number=0}
> Options:{{}}UUID: 7380513f-09ca-4209-a770-50bcfb82c3e4  UUID: 
> 7380513f-09ca-4209-a770-50bcfb82c3e4 delegateCoder: 
> org.apache.beam.sdk.coders.Coder$ByteBuddy$6yeAkNko@2dd884d
>       at 
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.HashBiMap.putInverse(HashBiMap.java:315)
>       at 
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.HashBiMap.access$800(HashBiMap.java:59)
>       at 
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.HashBiMap$Inverse.put(HashBiMap.java:590)
>       at java.util.AbstractMap.putAll(AbstractMap.java:281)
>       at 
> org.apache.beam.runners.core.construction.SdkComponents.create(SdkComponents.java:99)
>       at 
> org.apache.beam.runners.core.construction.RehydratedComponents.getSdkComponents(RehydratedComponents.java:184)
>       at 
> org.apache.beam.sdk.expansion.service.ExpansionService.expand(ExpansionService.java:479)
>       at 
> org.apache.beam.sdk.expansion.service.ExpansionService.expand(ExpansionService.java:546)
>       at 
> org.apache.beam.model.expansion.v1.ExpansionServiceGrpc$MethodHandlers.invoke(ExpansionServiceGrpc.java:219)
>       at 
> org.apache.beam.vendor.grpc.v1p36p0.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
>       at 
> org.apache.beam.vendor.grpc.v1p36p0.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
>       at 
> org.apache.beam.vendor.grpc.v1p36p0.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:797)
>       at 
> org.apache.beam.vendor.grpc.v1p36p0.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
>       at 
> org.apache.beam.vendor.grpc.v1p36p0.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>       at java.lang.Thread.run(Thread.java:748)
> {code}
> The code to produce the error:
> {code:python}
> p = beam.Pipeline()
> numbers = (p | beam.Create(range(10))
>                         | beam.Map(lambda x: beam.Row(number=x)))
> numbers2 = (p | beam.Create(range(5,15))
>                           | beam.Map(lambda x: beam.Row(number=x)))
> common_numbers = {'numbers': numbers, 'numbers2': numbers2} | 
>     beam.transforms.sql.SqlTransform("""
>         SELECT * FROM numbers JOIN numbers2 ON numbers.number = 
> numbers2.number
>     """)
> {code}
> However, if we define the Row schema of `numbers2` to a different schema such 
> as `beam.Row(number2=x)`. Then make the join `ON numbers.number = 
> numbers2.number2`. The transform can be successfully applied. The pipeline 
> can also be executed successfully later.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to