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

ASF GitHub Bot logged work on GOBBLIN-1367:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Jan/21 05:59
            Start Date: 22/Jan/21 05:59
    Worklog Time Spent: 10m 
      Work Description: codecov-io edited a comment on pull request #3209:
URL: 
https://github.com/apache/incubator-gobblin/pull/3209#issuecomment-764450255


   # 
[Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=h1)
 Report
   > Merging 
[#3209](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=desc)
 (07d9511) into 
[master](https://codecov.io/gh/apache/incubator-gobblin/commit/2fa3553c75775d2d2a3a98f51c92b5c758c7abc9?el=desc)
 (2fa3553) will **decrease** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/graphs/tree.svg?width=650&height=150&src=pr&token=4MgURJ0bGc)](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3209      +/-   ##
   ============================================
   - Coverage     46.23%   46.23%   -0.01%     
   - Complexity     9788     9797       +9     
   ============================================
     Files          2019     2019              
     Lines         77439    77504      +65     
     Branches       8602     8606       +4     
   ============================================
   + Hits          35807    35837      +30     
   - Misses        38300    38334      +34     
   - Partials       3332     3333       +1     
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=tree) 
| Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | 
[...pache/gobblin/source/jdbc/PostgresqlExtractor.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4tc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NvdXJjZS9qZGJjL1Bvc3RncmVzcWxFeHRyYWN0b3IuamF2YQ==)
 | `50.00% <100.00%> (+20.17%)` | `14.00 <0.00> (+2.00)` | |
   | 
[...obblin/yarn/YarnAppSecurityManagerWithKeytabs.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vWWFybkFwcFNlY3VyaXR5TWFuYWdlcldpdGhLZXl0YWJzLmphdmE=)
 | `8.33% <0.00%> (-13.55%)` | `1.00% <0.00%> (-1.00%)` | |
   | 
[...he/gobblin/source/PartitionAwareFileRetriever.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NvdXJjZS9QYXJ0aXRpb25Bd2FyZUZpbGVSZXRyaWV2ZXIuamF2YQ==)
 | `48.14% <0.00%> (-7.41%)` | `0.00% <0.00%> (ø%)` | |
   | 
[...in/java/org/apache/gobblin/cluster/HelixUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvSGVsaXhVdGlscy5qYXZh)
 | `32.23% <0.00%> (-5.79%)` | `12.00% <0.00%> (-2.00%)` | |
   | 
[...a/org/apache/gobblin/cluster/GobblinHelixTask.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvR29iYmxpbkhlbGl4VGFzay5qYXZh)
 | `58.06% <0.00%> (-2.16%)` | `6.00% <0.00%> (ø%)` | |
   | 
[...n/java/org/apache/gobblin/yarn/YarnHelixUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vWWFybkhlbGl4VXRpbHMuamF2YQ==)
 | `32.69% <0.00%> (-2.01%)` | `8.00% <0.00%> (ø%)` | |
   | 
[...rg/apache/gobblin/yarn/GobblinYarnAppLauncher.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vR29iYmxpbllhcm5BcHBMYXVuY2hlci5qYXZh)
 | `24.10% <0.00%> (-0.06%)` | `12.00% <0.00%> (ø%)` | |
   | 
[...ava/org/apache/gobblin/util/hadoop/TokenUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvaGFkb29wL1Rva2VuVXRpbHMuamF2YQ==)
 | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
   | 
[...e/gobblin/yarn/AbstractYarnAppSecurityManager.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vQWJzdHJhY3RZYXJuQXBwU2VjdXJpdHlNYW5hZ2VyLmphdmE=)
 | `49.47% <0.00%> (+1.19%)` | `7.00% <0.00%> (+1.00%)` | |
   | 
[...a/management/copy/publisher/CopyDataPublisher.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvcHVibGlzaGVyL0NvcHlEYXRhUHVibGlzaGVyLmphdmE=)
 | `75.33% <0.00%> (+1.33%)` | `32.00% <0.00%> (+1.00%)` | |
   | ... and [6 
more](https://codecov.io/gh/apache/incubator-gobblin/pull/3209/diff?src=pr&el=tree-more)
 | |
   
   ------
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=footer).
 Last update 
[2fa3553...07d9511](https://codecov.io/gh/apache/incubator-gobblin/pull/3209?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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: 539673)
    Time Spent: 1h  (was: 50m)

> Fix PostgresqlExtractor's unnecessary string replacement
> --------------------------------------------------------
>
>                 Key: GOBBLIN-1367
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1367
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-sql
>            Reporter: Kengo Seki
>            Assignee: Shirshanka Das
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> I tried to run PostgreSQL Source/Extractor with the following minimal config,
> {code}
> $ psql
> psql (12.5 (Ubuntu 12.5-0ubuntu0.20.04.1))
> Type "help" for help.
> sekikn=# \c
> You are now connected to database "sekikn" as user "sekikn".
> sekikn=# \d
>  public | t    | table | sekikn
> sekikn=# \d t
>  c      | character varying |           |          | 
> {code}
> {code}
> $ cat ~/postgres_to_console.job 
> source.class=org.apache.gobblin.source.extractor.extract.jdbc.PostgresqlSource
> source.conn.driver=org.postgresql.Driver
> source.conn.username=sekikn
> source.conn.password=********
> source.conn.host=localhost
> source.conn.port=5432
> source.conn.database=sekikn
> source.querybased.schema=public
> source.entity=t
> extract.table.type=SNAPSHOT_APPEND
> writer.builder.class=org.apache.gobblin.writer.ConsoleWriterBuilder
> data.publisher.type=org.apache.gobblin.publisher.NoopPublisher
> {code}
> but came across the following error.
> {code}
> $ bin/gobblin cli run -jobName postgres_to_console -jobFile 
> ~/postgres_to_console.job
> (snip)
> 2021-01-21 07:45:40 JST INFO  [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - 
> Extract metadata using JDBC
> 2021-01-21 07:45:40 JST INFO  [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - 
> Executing query:select col.column_name, col.data_type, case when 
> CHARACTER_OCTET_LENGTH is null then 0 else 0 end as length, case when 
> NUMERIC_PRECISION is null then 0 else NUMERIC_PRECISION end as precesion, 
> case when NUMERIC_SCALE is null then 0 else NUMERIC_SCALE end as scale, case 
> when is_nullable='NO' then 'false' else 'true' end as nullable, '' as format, 
> '' as comment from information_schema.COLUMNS col WHERE 
> upper(col.table_name)=upper(?) AND upper(col.table_schema)=upper(?) order by 
> col.ORDINAL_POSITION
> 2021-01-21 07:45:40 JST INFO  [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - 
> Schema:[{"columnName":"c","dataType":{"type":"string"},"isWaterMark":false,"primaryKey":0,"length":0,"precision":0,"scale":0,"isNullable":true,"format":"","comment":"","isUnique":false}]
> 2021-01-21 07:45:40 JST INFO  [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - 
> Extract query: SELECT c FROM public.t where ('$WATERMARK')
> 2021-01-21 07:45:40 JST INFO  [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - Get 
> source record count using JDBC
> 2021-01-21 07:45:40 JST INFO  [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - 
> Executing query:SELECT COUNT(1) FROM publiCOUNT(1).t where (1=1)
> 2021-01-21 07:45:40 JST ERROR [gobblin-instance-driver] 
> org.apache.gobblin.source.jdbc.JdbcExtractor [public_t_1611182740226_0] - 
> Failed to execute sql:SELECT COUNT(1) FROM publiCOUNT(1).t where (1=1) 
> ;error-ERROR: syntax error at or near "."
>   Position: 35
> org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
>   Position: 35
>       at 
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
>       at 
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)
>       at 
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
>       at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
>       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
>       at 
> org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
>       at 
> org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
>       at 
> org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
>       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260)
>       at 
> org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
>       at 
> org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
>       at 
> org.apache.gobblin.source.jdbc.JdbcExtractor.executeSql(JdbcExtractor.java:666)
>       at 
> org.apache.gobblin.source.jdbc.JdbcExtractor.getSourceCount(JdbcExtractor.java:797)
>       at 
> org.apache.gobblin.source.extractor.extract.QueryBasedExtractor.build(QueryBasedExtractor.java:326)
>       at 
> org.apache.gobblin.source.extractor.extract.jdbc.PostgresqlSource.getExtractor(PostgresqlSource.java:47)
>       at 
> org.apache.gobblin.runtime.TaskContext.getExtractor(TaskContext.java:120)
>       at org.apache.gobblin.runtime.Task.<init>(Task.java:196)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.createTaskRunnable(GobblinMultiTaskAttempt.java:485)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.access$100(GobblinMultiTaskAttempt.java:86)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt$2.call(GobblinMultiTaskAttempt.java:511)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt$2.call(GobblinMultiTaskAttempt.java:505)
>       at 
> com.github.rholder.retry.AttemptTimeLimiters$NoAttemptTimeLimit.call(AttemptTimeLimiters.java:78)
>       at com.github.rholder.retry.Retryer.call(Retryer.java:160)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.createTaskWithRetry(GobblinMultiTaskAttempt.java:505)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.runWorkUnits(GobblinMultiTaskAttempt.java:421)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.run(GobblinMultiTaskAttempt.java:157)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.runAndOptionallyCommitTaskAttempt(GobblinMultiTaskAttempt.java:521)
>       at 
> org.apache.gobblin.runtime.GobblinMultiTaskAttempt.runWorkUnits(GobblinMultiTaskAttempt.java:563)
>       at 
> org.apache.gobblin.runtime.local.LocalJobLauncher.runWorkUnitStream(LocalJobLauncher.java:156)
>       at 
> org.apache.gobblin.runtime.AbstractJobLauncher.launchJob(AbstractJobLauncher.java:508)
>       at 
> org.apache.gobblin.runtime.job_exec.JobLauncherExecutionDriver$DriverRunnable.call(JobLauncherExecutionDriver.java:164)
>       at 
> org.apache.gobblin.runtime.job_exec.JobLauncherExecutionDriver$DriverRunnable.call(JobLauncherExecutionDriver.java:152)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at java.lang.Thread.run(Thread.java:748)
> 2021-01-21 07:45:40 JST ERROR [gobblin-instance-driver] 
> org.apache.gobblin.source.extractor.extract.jdbc.PostgresqlSource 
> [public_t_1611182740226_0] - Failed to prepare extractor: error - Failed to 
> get record count; error - Failed to get source record count using JDBC; error 
> - Failed to get source record count from database; error - null
> {code}
> This is because the target schema and table (publi"c".t) contains the name of 
> column (c), so it was replaced wrongly. PostgresqlExtractor should replace 
> only the first occurrence of the target substring here.
>  
> [https://github.com/apache/incubator-gobblin/blob/release-0.15.0/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/PostgresqlExtractor.java#L134]



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

Reply via email to