how can Handling in flink this operation in sql bettween ,like , In

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

how can Handling in flink this operation in sql bettween ,like , In

hagersaleh


1- BETWEEN Operator  Sql Example
SELECT * FROM Products
WHERE Price BETWEEN 10 AND 20;
2- The SQL LIKE Operator Example
SELECT * FROM Customers
WHERE City LIKE 's%';
3-IN Operator Example
SELECT * FROM Customers
WHERE City IN ('Paris','London');
Reply | Threaded
Open this post in threaded view
|

Re: how can Handling in flink this operation in sql bettween ,like , In

rmetzger0
Hi,

all these operations can be implemented in Flink using the "filter()" function.

For example BETWEEN:

DataSet<Product> products = env.createFromElements(...);
products..filter(new FilterFunction<Product>() {
   @Override
public boolean filter(Product value) throws Exception {
return value.price >= 10 && value.price <= 20;
}
})

You can implement the other filters in a similar fashion.

Best,
Robert


On Sun, Apr 12, 2015 at 2:44 PM, hagersaleh <[hidden email]> wrote:


1- BETWEEN Operator  Sql Example
SELECT * FROM Products
WHERE Price BETWEEN 10 AND 20;
2- The SQL LIKE Operator Example
SELECT * FROM Customers
WHERE City LIKE 's%';
3-IN Operator Example
SELECT * FROM Customers
WHERE City IN ('Paris','London');



--
View this message in context: http://apache-flink-incubator-user-mailing-list-archive.2336050.n4.nabble.com/how-can-Handling-in-flink-this-operation-in-sql-bettween-like-In-tp985.html
Sent from the Apache Flink (Incubator) User Mailing List archive. mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: how can Handling in flink this operation in sql bettween ,like , In

hagersaleh
Thank you very much
example on like and in operation