Re: Compiler error while using 'CsvTableSource'

2017-02-06 Thread nsengupta
Thanks, Timo.

Do I need to add anything to the ticket? Please let me know. I will do the
needful.

-- N

On Mon, Feb 6, 2017 at 2:25 PM, Timo Walther [via Apache Flink User Mailing
List archive.] <ml-node+s2336050n11452...@n4.nabble.com> wrote:

> I created an issue to make this a bit more user-friendly in the future.
>
> https://issues.apache.org/jira/browse/FLINK-5714
>
> Timo
>
>
> Am 05/02/17 um 06:08 schrieb nsengupta:
>
> Thanks, Till, for taking time to share your understanding.
>
> -- N
>
> On Sun, Feb 5, 2017 at 12:49 AM, Till Rohrmann [via Apache Flink User
> Mailing List archive.] <[hidden email]
> <http:///user/SendEmail.jtp?type=node=11443=0>> wrote:
>
>> I think the problem is that there are actually two constructors with the
>> same signature. The one is defined with default arguments and the other has
>> the same signature as the one with default arguments when you leave all
>> default arguments out. I assume that this confuses the Scala compiler and
>> only works if you've specified the right types or at least one of the
>> parameters with a default argument.
>>
>> Cheers,
>> Till
>>
>> On Fri, Feb 3, 2017 at 12:49 PM, nsengupta <[hidden email]
>> <http:///user/SendEmail.jtp?type=node=11441=0>> wrote:
>>
>>> Till,
>>>
>>> Many thanks. Just to confirm that it is working fine at my end, here's a
>>> screenshot.
>>>
>>> <http://apache-flink-user-mailing-list-archive.2336050.n4.na
>>> bble.com/file/n11427/Selection_258.png>
>>>
>>> This is Flink 1.1.4 but Flink-1.2/Flink-1.3 shouldn't be any problem.
>>>
>>> It never struck me that lack of covariance in Scala Arrays was the
>>> source of
>>> the problem. Bravo!
>>>
>>> BTW, I am just curious to know how the Testcases worked: just to add to
>>> my
>>> knowledge of Scala. We didn't pass any /typehint/ to the compiler there!
>>>
>>> Could you please put a hint of a line or two? TIA.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://apache-flink-user-maili
>>> ng-list-archive.2336050.n4.nabble.com/Compiler-error-while-
>>> using-CsvTableSource-tp11412p11427.html
>>> Sent from the Apache Flink User Mailing List archive. mailing list
>>> archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://apache-flink-user-mailing-list-archive.2336050.n4.
>> nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11441.html
>> To unsubscribe from Compiler error while using 'CsvTableSource', click
>> here.
>> NAML
>> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> Software Technologist
> http://www.linkedin.com/in/nirmalyasengupta
> "If you have built castles in the air, your work need not be lost. That is
> where they should be.
> Now put the foundation under them."
>
> --
> View this message in context: Re: Compiler error while using
> 'CsvTableSource'
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11443.html>
> Sent from the Apache Flink User Mailing List archive. mailing list archive
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/> at
> Nabble.com.
>
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11452.html
> To unsubscribe from Compiler error while using 'CsvTableSource', click
> here
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=11412=c2VuZ3VwdGEubmlybWFseWFAZ21haWwuY29tfDExNDEyfC01NzQyMjQyNDk=>
> .
> NA

Re: Compiler error while using 'CsvTableSource'

2017-02-06 Thread Timo Walther

I created an issue to make this a bit more user-friendly in the future.

https://issues.apache.org/jira/browse/FLINK-5714

Timo


Am 05/02/17 um 06:08 schrieb nsengupta:

Thanks, Till, for taking time to share your understanding.

-- N

On Sun, Feb 5, 2017 at 12:49 AM, Till Rohrmann [via Apache Flink User 
Mailing List archive.] <[hidden email] 
> wrote:


I think the problem is that there are actually two constructors
with the same signature. The one is defined with default arguments
and the other has the same signature as the one with default
arguments when you leave all default arguments out. I assume that
this confuses the Scala compiler and only works if you've
specified the right types or at least one of the parameters with a
default argument.

Cheers,
Till

On Fri, Feb 3, 2017 at 12:49 PM, nsengupta <[hidden email]
<http:///user/SendEmail.jtp?type=node=11441=0>> wrote:

Till,

Many thanks. Just to confirm that it is working fine at my
end, here's a
screenshot.


<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11427/Selection_258.png

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11427/Selection_258.png>>

This is Flink 1.1.4 but Flink-1.2/Flink-1.3 shouldn't be any
problem.

It never struck me that lack of covariance in Scala Arrays was
the source of
the problem. Bravo!

BTW, I am just curious to know how the Testcases worked: just
to add to my
knowledge of Scala. We didn't pass any /typehint/ to the
compiler there!

Could you please put a hint of a line or two? TIA.





--
View this message in context:

http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11427.html

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11427.html>
Sent from the Apache Flink User Mailing List archive. mailing
list archive at Nabble.com.





If you reply to this email, your message will be added to the
discussion below:

http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11441.html

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11441.html>

    To unsubscribe from Compiler error while using 'CsvTableSource',
click here.
NAML

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>





--
Software Technologist
http://www.linkedin.com/in/nirmalyasengupta
"If you have built castles in the air, your work need not be lost. 
That is where they should be.

Now put the foundation under them."

--------
View this message in context: Re: Compiler error while using 
'CsvTableSource' 
<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11443.html>
Sent from the Apache Flink User Mailing List archive. mailing list 
archive 
<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/> 
at Nabble.com.





Re: Compiler error while using 'CsvTableSource'

2017-02-04 Thread nsengupta
Thanks, Till, for taking time to share your understanding.

-- N

On Sun, Feb 5, 2017 at 12:49 AM, Till Rohrmann [via Apache Flink User
Mailing List archive.] <ml-node+s2336050n11441...@n4.nabble.com> wrote:

> I think the problem is that there are actually two constructors with the
> same signature. The one is defined with default arguments and the other has
> the same signature as the one with default arguments when you leave all
> default arguments out. I assume that this confuses the Scala compiler and
> only works if you've specified the right types or at least one of the
> parameters with a default argument.
>
> Cheers,
> Till
>
> On Fri, Feb 3, 2017 at 12:49 PM, nsengupta <[hidden email]
> <http:///user/SendEmail.jtp?type=node=11441=0>> wrote:
>
>> Till,
>>
>> Many thanks. Just to confirm that it is working fine at my end, here's a
>> screenshot.
>>
>> <http://apache-flink-user-mailing-list-archive.2336050.n4.
>> nabble.com/file/n11427/Selection_258.png>
>>
>> This is Flink 1.1.4 but Flink-1.2/Flink-1.3 shouldn't be any problem.
>>
>> It never struck me that lack of covariance in Scala Arrays was the source
>> of
>> the problem. Bravo!
>>
>> BTW, I am just curious to know how the Testcases worked: just to add to my
>> knowledge of Scala. We didn't pass any /typehint/ to the compiler there!
>>
>> Could you please put a hint of a line or two? TIA.
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://apache-flink-user-maili
>> ng-list-archive.2336050.n4.nabble.com/Compiler-error-whil
>> e-using-CsvTableSource-tp11412p11427.html
>> Sent from the Apache Flink User Mailing List archive. mailing list
>> archive at Nabble.com.
>>
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11441.html
> To unsubscribe from Compiler error while using 'CsvTableSource', click
> here
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=11412=c2VuZ3VwdGEubmlybWFseWFAZ21haWwuY29tfDExNDEyfC01NzQyMjQyNDk=>
> .
> NAML
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Software Technologist
http://www.linkedin.com/in/nirmalyasengupta
"If you have built castles in the air, your work need not be lost. That is
where they should be.
Now put the foundation under them."




--
View this message in context: 
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11443.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at 
Nabble.com.

Re: Compiler error while using 'CsvTableSource'

2017-02-04 Thread Till Rohrmann
I think the problem is that there are actually two constructors with the
same signature. The one is defined with default arguments and the other has
the same signature as the one with default arguments when you leave all
default arguments out. I assume that this confuses the Scala compiler and
only works if you've specified the right types or at least one of the
parameters with a default argument.

Cheers,
Till

On Fri, Feb 3, 2017 at 12:49 PM, nsengupta <sengupta.nirma...@gmail.com>
wrote:

> Till,
>
> Many thanks. Just to confirm that it is working fine at my end, here's a
> screenshot.
>
> <http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/file/n11427/Selection_258.png>
>
> This is Flink 1.1.4 but Flink-1.2/Flink-1.3 shouldn't be any problem.
>
> It never struck me that lack of covariance in Scala Arrays was the source
> of
> the problem. Bravo!
>
> BTW, I am just curious to know how the Testcases worked: just to add to my
> knowledge of Scala. We didn't pass any /typehint/ to the compiler there!
>
> Could you please put a hint of a line or two? TIA.
>
>
>
>
>
> --
> View this message in context: http://apache-flink-user-
> mailing-list-archive.2336050.n4.nabble.com/Compiler-error-
> while-using-CsvTableSource-tp11412p11427.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive
> at Nabble.com.
>


Re: Compiler error while using 'CsvTableSource'

2017-02-03 Thread nsengupta
Till,

Many thanks. Just to confirm that it is working fine at my end, here's a
screenshot. 

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11427/Selection_258.png>
 

This is Flink 1.1.4 but Flink-1.2/Flink-1.3 shouldn't be any problem.

It never struck me that lack of covariance in Scala Arrays was the source of
the problem. Bravo! 

BTW, I am just curious to know how the Testcases worked: just to add to my
knowledge of Scala. We didn't pass any /typehint/ to the compiler there! 

Could you please put a hint of a line or two? TIA.





--
View this message in context: 
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11427.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at 
Nabble.com.


Re: Compiler error while using 'CsvTableSource'

2017-02-03 Thread Till Rohrmann
This should do the trick val csvTableSource = new CsvTableSource("foobar",
Array("base"),
Array[org.apache.flink.api.common.typeinfo.TypeInformation[_]](Types.STRING)).
The problem is that arrays in Scala are not covariant.

Cheers,
Till
​

On Fri, Feb 3, 2017 at 6:39 AM, nsengupta <sengupta.nirma...@gmail.com>
wrote:

> Til,
>
> FWIW, I have fired the entire testsuite for Flink latest Snapshot.
>
> Almost all testcases passed, particularly this one:
>
> <http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/file/n11422/Selection_254.png>
>
> This case uses a bulit-in loaded CSV (in
> org.apache.flink.table.api.scala.batch.TableSourceTest.scala):
>
> <http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/file/n11422/Selection_255.png>
>
> Because this testcase runs, I presume that compiler is able to sort out the
> TypeInformation while building Flink-libraries, but while running, it is
> failing to do so, for some reason.
>
> -- Nirmalya
>
>
>
>
>
> --
> View this message in context: http://apache-flink-user-
> mailing-list-archive.2336050.n4.nabble.com/Compiler-error-
> while-using-CsvTableSource-tp11412p11422.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive
> at Nabble.com.
>


Re: Compiler error while using 'CsvTableSource'

2017-02-02 Thread nsengupta
Til,

FWIW, I have fired the entire testsuite for Flink latest Snapshot.

Almost all testcases passed, particularly this one:

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11422/Selection_254.png>
 

This case uses a bulit-in loaded CSV (in
org.apache.flink.table.api.scala.batch.TableSourceTest.scala):

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11422/Selection_255.png>
 

Because this testcase runs, I presume that compiler is able to sort out the
TypeInformation while building Flink-libraries, but while running, it is
failing to do so, for some reason.

-- Nirmalya





--
View this message in context: 
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11422.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at 
Nabble.com.


Re: Compiler error while using 'CsvTableSource'

2017-02-02 Thread nsengupta
Hello Till,

Many thanks for a quick reply. 

I have tried to follow your suggestion, with no luck:
<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11421/Selection_251.png>
 

Just to give it a shot, I have tried this too (following Flink
Documentation):

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11421/Selection_252.png>
 


I took, a cursory look at the source code and stumbled upon this file:
./flink-libraries/flink-table/src/test/scala/org/apache/flink/table/utils/*CommonTestData.scala*

Here, I see that you are using *BasicTypeInfo* while creating a
*CsvTableSource* and I have tried that too:

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11421/Selection_253.png>
 

Because I ordered maven to skipTests, while building Flink binaries, I don't
know if this particular testcase passed or not. If it did, then I think we
can conclude that it is a case of Scala's failure to resolve type, perhaps
due to an implicit. It it didn't, then we perhaps have an easier problem to
solve.

Do you think I should run all the tests in my environment? It may take time,
but I can do that if it helps us.

-- Nirmalya







--
View this message in context: 
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412p11421.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at 
Nabble.com.


Re: Compiler error while using 'CsvTableSource'

2017-02-02 Thread Till Rohrmann
Hi Nirmalya,

could you try casting the Types.STRING into a
org.apache.flink.api.common.typeinfo.TypeInformation[String] type?

Cheers,
Till

On Thu, Feb 2, 2017 at 5:55 PM, nsengupta <sengupta.nirma...@gmail.com>
wrote:

> I am using *flink-shell*, available with flink-1.2-SNAPSHOT.
>
> While loading a CSV file into a CsvTableSource - following the example
> given
> with the documents - I get this error.
>
> <http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/file/n11412/Selection_250.png>
>
> I am not sure what the reason is! Am I missing import of an *implicit*
> somewhere?
>
> Any help, appreciated.
>
> -- Nirmalya
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://apache-flink-user-
> mailing-list-archive.2336050.n4.nabble.com/Compiler-error-
> while-using-CsvTableSource-tp11412.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive
> at Nabble.com.
>


Compiler error while using 'CsvTableSource'

2017-02-02 Thread nsengupta
I am using *flink-shell*, available with flink-1.2-SNAPSHOT.

While loading a CSV file into a CsvTableSource - following the example given
with the documents - I get this error.

<http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/n11412/Selection_250.png>
 

I am not sure what the reason is! Am I missing import of an *implicit*
somewhere?

Any help, appreciated.

-- Nirmalya













--
View this message in context: 
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Compiler-error-while-using-CsvTableSource-tp11412.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at 
Nabble.com.