You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wayang.apache.org by GitBox <gi...@apache.org> on 2022/05/16 10:44:23 UTC
[GitHub] [incubator-wayang] gstamatakis opened a new issue, #229: Wayang JOIN operator can't be placed in Postgres
gstamatakis opened a new issue, #229:
URL: https://github.com/apache/incubator-wayang/issues/229
Greetings,
I'm facing the following error when attempting to execute a single JOIN operation in Postgres.
First and foremost I'm assuming that a JOIN operator can be placed in Postgres, if not please feel free to close this issue as off-topic.
More specifically, I'm attempting to load 2 Postgres tables and join on their primary key.
I'm manually restricting the JOIN Operator to run on a `Postgres.platform()` and both Postgres.readTable operations also placed in Postgres. The result is a WayangException that informed me that no plans could be produced (see attached logs).
The following code chunk is the Wayang code I'm trying to execute.
```
/* Builder to prepare and execute the plan */
val planBuilder = new PlanBuilder(wayangContext, jobName = "ExampleJob")
/* Tables/Tuples fetching functions */
val createTableSourceKeyword = new PostgresTableSource("keyword", "id", "keyword", "phonetic_code")
val createTableSourceMovieKeyword = new PostgresTableSource("movie_keyword", "id", "movie_id", "keyword_id")
// Left relation
val left = planBuilder.readTable(createTableSourceKeyword).withName("load_left").withTargetPlatforms(planner.place("load_left"))
.filter(_.getString(1) == "character-name-in-title", sqlUdf = "keyword = 'character-name-in-title'", selectivity = 1.0).withName("filter1").withTargetPlatforms(planner.place("filter1"))
// Right relation
val right = planBuilder.readTable(createTableSourceMovieKeyword).withName("load_right").withTargetPlatforms(planner.place("load_right"))
// Execute the JOIN and return the results
left
.join[Record, Int](thisKeyUdf = _.getInt(0), that = right, thatKeyUdf = row => row.getInt(0)).withName("join1").withTargetPlatforms(planner.place("join1"))
//Fetch all items but only keep a few to avoid memory issues
.collect()
```
Logs
[wayang_logs.txt](https://github.com/apache/incubator-wayang/files/8699336/wayang_logs.txt)
Stacktrace
```
Exception in thread "main" org.apache.wayang.core.api.exception.WayangException: Could not find a single execution plan.
at org.apache.wayang.core.optimizer.enumeration.PlanEnumerator.enumerate(PlanEnumerator.java:305)
at org.apache.wayang.core.api.Job.createInitialExecutionPlan(Job.java:417)
at org.apache.wayang.core.api.Job.doExecute(Job.java:290)
at org.apache.wayang.core.util.OneTimeExecutable.tryExecute(OneTimeExecutable.java:41)
at org.apache.wayang.core.util.OneTimeExecutable.execute(OneTimeExecutable.java:54)
at org.apache.wayang.core.api.Job.execute(Job.java:244)
at org.apache.wayang.core.api.WayangContext.execute(WayangContext.java:120)
at org.apache.wayang.core.api.WayangContext.execute(WayangContext.java:108)
at org.apache.wayang.api.PlanBuilder.buildAndExecute(PlanBuilder.scala:102)
at org.apache.wayang.api.DataQuanta.collect(DataQuanta.scala:755)
at org.athenarc.flow.Query1Flow.execute(Query1Flow.scala:47)
at org.athenarc.orchestrator.SimpleOrchestrator.run(SimpleOrchestrator.scala:28)
at org.athenarc.execution.Query1Execution$.run(Query1Execution.scala:18)
at org.athenarc.Main$.$anonfun$main$1(Main.scala:50)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:285)
at scala.collection.immutable.Set$Set1.foreach(Set.scala:141)
at scala.collection.TraversableLike.map(TraversableLike.scala:285)
at scala.collection.TraversableLike.map$(TraversableLike.scala:278)
at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:53)
at scala.collection.SetLike.map(SetLike.scala:105)
at scala.collection.SetLike.map$(SetLike.scala:105)
at scala.collection.AbstractSet.map(Set.scala:53)
at org.athenarc.Main$.main(Main.scala:50)
at org.athenarc.Main.main(Main.scala)
```
--
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: commits-unsubscribe@wayang.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-wayang] berttty commented on issue #229: Wayang JOIN operator can't be placed in Postgres
Posted by GitBox <gi...@apache.org>.
berttty commented on issue #229:
URL: https://github.com/apache/incubator-wayang/issues/229#issuecomment-1128499338
Hi @gstamatakis, currently Postgres platform does not have the join operator, because Wayang does not have an sql generator to bring UDF to SQL code to send to Postgres.
--
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: commits-unsubscribe@wayang.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-wayang] gstamatakis commented on issue #229: Wayang JOIN operator can't be placed in Postgres
Posted by GitBox <gi...@apache.org>.
gstamatakis commented on issue #229:
URL: https://github.com/apache/incubator-wayang/issues/229#issuecomment-1133600616
Apologies for reviving this thread but I'm interested in implementing a simple equi join on 2 relations in Postgres. Is there a guide or any resources that you can point me to? Thanks in advance.
--
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: commits-unsubscribe@wayang.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-wayang] gstamatakis commented on issue #229: Wayang JOIN operator can't be placed in Postgres
Posted by GitBox <gi...@apache.org>.
gstamatakis commented on issue #229:
URL: https://github.com/apache/incubator-wayang/issues/229#issuecomment-1128506244
Hello @berttty, thanks for the quick response.
Although unfortunate, it's understandable. Are there any plans in your roadmap for adding JOINs in Postgres?
Regardless, you can consider this issue closed
--
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: commits-unsubscribe@wayang.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-wayang] gstamatakis closed issue #229: Wayang JOIN operator can't be placed in Postgres
Posted by GitBox <gi...@apache.org>.
gstamatakis closed issue #229: Wayang JOIN operator can't be placed in Postgres
URL: https://github.com/apache/incubator-wayang/issues/229
--
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: commits-unsubscribe@wayang.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org