how can Combine between two dataset in on datset and execution more condition in the same time

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how can Combine between two dataset in on datset and execution more condition in the same time

hagersaleh
how can Combine between two dataset in on datset and execution more condition in the same time
Example
SELECT employees.last_name
FROM employees E, departments D
WHERE (D.department_id = E.department_id AND D.location = 2400)
   AND (E.job_id = 'AC_ACCOUNT' OR E.salary > 60000);
Reply | Threaded
Open this post in threaded view
|

RE: how can Combine between two dataset in on datset and execution more condition in the same time

Kruse, Sebastian
Hi,

You might want to translate your SQL statement into an expression of the relational algebra at first [1]. This expression can be expressed with Flink's operators in a straight-forward manner.
In the end, it will look something like this:

Employees.filter(_.job_id = ...).join(departments.filter(_.location = ...).where("department_id").equalTo("department_id").apply( (employee, department) => employee.last_name)

Cheers,
Sebastian

[1] http://en.wikipedia.org/wiki/Relational_algebra

-----Original Message-----
From: hagersaleh [mailto:[hidden email]]
Sent: Donnerstag, 11. Juni 2015 13:41
To: [hidden email]
Subject: how can Combine between two dataset in on datset and execution more condition in the same time

how can Combine between two dataset in on datset and execution more condition in the same time Example SELECT employees.last_name FROM employees E, departments D WHERE (D.department_id = E.department_id AND D.location = 2400)
   AND (E.job_id = 'AC_ACCOUNT' OR E.salary > 60000);




--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/how-can-Combine-between-two-dataset-in-on-datset-and-execution-more-condition-in-the-same-time-tp1605.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

RE: how can Combine between two dataset in on datset and execution more condition in the same time

hagersaleh
apply not found in flink
and how can execute this
SELECT employees.last_name
 FROM employees E, departments D
 WHERE (D.department_id = E.department_id AND E.job_id = 'AC_ACCOUNT' AND
D.location = 2400)
  OR
  E.department_id = D.department_id AND E.salary > 60000 AND D.location = 2400);
Reply | Threaded
Open this post in threaded view
|

RE: how can Combine between two dataset in on datset and execution more condition in the same time

Kruse, Sebastian
That example was written in Scala, if you are using Java, then the join function is applied with the function "with(..)". However, logically you do the same in Scala and Java, there a just some minor differences in the API.

-----Original Message-----
From: hagersaleh [mailto:[hidden email]]
Sent: Donnerstag, 11. Juni 2015 22:34
To: [hidden email]
Subject: RE: how can Combine between two dataset in on datset and execution more condition in the same time

apply not found in flink
and how can execute this
SELECT employees.last_name
 FROM employees E, departments D
 WHERE (D.department_id = E.department_id AND E.job_id = 'AC_ACCOUNT' AND D.location = 2400)
  OR
  E.department_id = D.department_id AND E.salary > 60000 AND D.location = 2400);




--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/how-can-Combine-between-two-dataset-in-on-datset-and-execution-more-condition-in-the-same-time-tp1605p1614.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

RE: how can Combine between two dataset in on datset and execution more condition in the same time

hagersaleh
can combine between tow table but not use join