HI ,
I want to query some sql table that contains ~80m rows. There is a few ways to do that and i wonder what is the best way to do that .
Or something else that is much efficient ? Thanks, Miki |
You can pass a ParametersProvider to the jdbc input format in order to parallelize the fetch. Of course you don't have to kill the mysql server with too many request in parallel so you'll probably put a limit to the parallelism of the input format. On Tue, 4 Dec 2018, 17:31 miki haiat <[hidden email] wrote:
|
Im using jdts driver to query mssql . I used the
ParametersProvider as you suggested but for some reason the job wont run parallel .Also the sink , a simple print out wont parallel On Tue, Dec 4, 2018 at 10:05 PM Flavio Pompermaier <[hidden email]> wrote:
|
whats your query? Have you used '?' where query should be parameterized? |
hi Flavio , This is the query that im trying to coordinate .setQuery("SELECT a, b, c, \n" + And this is the way im trying to parameterized ParameterValuesProvider pramProvider = new NumericBetweenParametersProvider(10000, 3,300); I also tried this way Serializable[][] queryParameters = new String[1][2]; On Wed, Dec 5, 2018 at 6:44 PM Flavio Pompermaier <[hidden email]> wrote:
|
the constructor of NumericBetweenParametersProvider takes 3 params: long fetchSize, long minVal, long maxVal. If you want parallelism you should use a 1 < fetchSize < maxVal. In your case, if you do new NumericBetweenParametersProvider(50, 3, 300) you will produce 6 parallel tasks:
On Thu, Dec 6, 2018 at 10:32 AM miki haiat <[hidden email]> wrote:
|
Hi Flavio , That working fine for and im able to pull ~17m rows in 20 seconds. Im a bit confuse regarding the state backhand , I could find a way to configure it so im guessing the data is in the memory ... thanks, Miki On Thu, Dec 6, 2018 at 12:06 PM Flavio Pompermaier <[hidden email]> wrote:
|
That inputformat is a batch one, so there's no state backend. You need to output the fetched data somewhere AFAIK
On Thu, Dec 6, 2018 at 3:49 PM miki haiat <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |