Skip to content

Commit

Permalink
Fix issue 3
Browse files Browse the repository at this point in the history
Alias the subquery in postgresql
  • Loading branch information
osalvador committed Jan 13, 2020
1 parent 83bd7ba commit 74f5359
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.replicadb</groupId>
<artifactId>ReplicaDB</artifactId>
<version>0.6.0</version>
<version>0.6.1</version>

<name>ReplicaDB</name>
<url>https://github.com/osalvador/ReplicaDB</url>
Expand Down Expand Up @@ -108,7 +108,7 @@
<!--<dependency>-->
<!--<groupId>com.denodo</groupId>-->
<!--<artifactId>denodo</artifactId>-->
<!--<version>6.0</version>-->
<!--<version>7.0</version>-->
<!--</dependency>-->


Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/replicadb/manager/PostgresqlManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public ResultSet readTable(String tableName, String[] columns, int nThread) thro
// Read table with source-query option specified
if (options.getSourceQuery() != null && !options.getSourceQuery().isEmpty()) {
sqlCmd = "SELECT * FROM (" +
options.getSourceQuery() + ") OFFSET ? ";
options.getSourceQuery() + ") as T1 OFFSET ? ";
} else {

sqlCmd = "SELECT " +
Expand Down Expand Up @@ -284,7 +284,7 @@ public void preSourceTasks() throws SQLException {

// Source Query
if (options.getSourceQuery() != null && !options.getSourceQuery().isEmpty()) {
sql = sql + "( " + this.options.getSourceQuery() + " )";
sql = sql + "( " + this.options.getSourceQuery() + " ) as T1";

} else {

Expand Down

0 comments on commit 74f5359

Please sign in to comment.