[
https://issues.apache.org/jira/browse/BEAM-7513?focusedWorklogId=260622&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-260622
]
ASF GitHub Bot logged work on BEAM-7513:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Jun/19 18:23
Start Date: 14/Jun/19 18:23
Worklog Time Spent: 10m
Work Description: akedin commented on pull request #8822: [BEAM-7513]
Adding Row Count for Bigquery Table
URL: https://github.com/apache/beam/pull/8822#discussion_r293925381
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/BeamCalciteTable.java
##########
@@ -67,11 +67,17 @@ public RelDataType getRowType(RelDataTypeFactory
typeFactory) {
@Override
public Statistic getStatistic() {
- BeamRowCountStatistics beamStatistics =
-
beamTable.getRowCount(BeamEnumerableConverter.createPipelineOptions(pipelineOptions));
- return beamStatistics.isUnknown()
- ? Statistics.UNKNOWN
- : Statistics.of(beamStatistics.getRowCount().doubleValue(),
ImmutableList.of());
+ final ClassLoader originalClassLoader =
Thread.currentThread().getContextClassLoader();
+ try {
+
Thread.currentThread().setContextClassLoader(BeamEnumerableConverter.class.getClassLoader());
Review comment:
Can you add a comment that points to `BeamEnumerableConverter` and explains
that this is required for JDBC path?
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 260622)
Time Spent: 50m (was: 40m)
> Row Estimation for BigQueryTable
> --------------------------------
>
> Key: BEAM-7513
> URL: https://issues.apache.org/jira/browse/BEAM-7513
> Project: Beam
> Issue Type: New Feature
> Components: dsl-sql, io-java-gcp
> Reporter: Alireza Samadianzakaria
> Assignee: Alireza Samadianzakaria
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Calcite tables (org.apache.calcite.schema.Table) should implement the method
> org.apache.calcite.schema.Statistic getStatistic(). The Statistic instance
> returned by this method is used for the Volcano optimizer in Calcite.
> Currently, org.apache.beam.sdk.extensions.sql.impl.BeamCalciteTable has not
> implemented getStatistic() which means it uses the implementation in
> org.apache.calcite.schema.impl.AbstractTable and that implementation just
> returns Statistics.UNKNOWN for all sources.
>
> Things needed to be implemented:
> 1- Implementing getStatistic in BeamCalciteTable such that it calls a row
> count estimation method from BeamSqlTable and adding this method to
> BeamSqlTable.
> 2- Implementing the row count estimation method for BigQueryTable.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)