Comments (10)
You could create two constructors. One constructor has one argument and the other constructor has two arguments.
from datafu.
I've tried that. There are two problems:
- I have to catch an IOException to call call()
- I have to return something to call call().
Hmmm I'll try again. Neither of those should block me.
On Sun, Jan 5, 2014 at 12:12 PM, Matt Hayes [email protected]:
You could create two constructors. One constructor has one argument and
the other constructor has two arguments.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614088
.
Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com
from datafu.
Oh I misunderstood I think. I thought you meant the constructor. Are you using SimpleEvalFunc? I don't think it supports this use case of a 2nd optional argument. If you look in the implementation of exec() you see this
// check right number of arguments
if (input.size() != pvec.length)
throw new IOException(String.format("%s: got %d arguments, expected %d.", _method_signature(), input.size(), pvec.length));
It expects there to be a call() method and it checks that the input tuple has the same number of values as there are arguments in the call() method.
I suggest just using EvalFunc then if you want optional parameters.
from datafu.
I thnk I made it work as you suggested. Testing now, but need to know how
to run just one test or it takes a half hour.
On Sunday, January 5, 2014, Matt Hayes wrote:
Oh I misunderstood I think. I thought you meant the constructor. Are you
using SimpleEvalFunc? I don't think it supports this use case of a 2nd
optional argument. If you look in the implementation of exec() you see this// check right number of arguments
if (input.size() != pvec.length)
throw new IOException(String.format("%s: got %d arguments, expected %d.", _method_signature(), input.size(), pvec.length));It expects there to be a call() method and it checks that the input tuple
has the same number of values as there are arguments in the call() method.I suggest just using EvalFunc then if you want optional parameters.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614362
.
Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com
from datafu.
Using two constructors doesn't work. I am using SimpleEvalFunc. Ok, I will try using EvalFunc.
from datafu.
Is there some way to modify SimpleEvalFunc so that I can use two constructors? I like using it.
from datafu.
I think you should be able to have multiple constructors with SimpleEvalFunc. You just can't have multiple overloaded call implementations. You just need to ensure each calls super(). What is the problem you are having?
from datafu.
I created call(String input) that calls call(String input, String path)
with default path. It fails with the same error as before: expected 2, got
1.
On Sunday, January 5, 2014, Matt Hayes wrote:
I think you should be able to have multiple constructors with
SimpleEvalFunc. You just can't have multiple overloaded call
implementations. You just need to ensure each calls super(). What is the
problem you are having?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614937
.
Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com
from datafu.
the call method is not a constructor
On Jan 5, 2014, at 1:11 PM, Russell Jurney [email protected] wrote:
I created call(String input) that calls call(String input, String path)
with default path. It fails with the same error as before: expected 2, got
1.On Sunday, January 5, 2014, Matt Hayes wrote:
I think you should be able to have multiple constructors with
SimpleEvalFunc. You just can't have multiple overloaded call
implementations. You just need to ensure each calls super(). What is the
problem you are having?�\
Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614937
.Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com
�
Reply to this email directly or view it on GitHub.
from datafu.
Good call. Lemme take another look.
On Sunday, January 5, 2014, Matt Hayes wrote:
the call method is not a constructor
On Jan 5, 2014, at 1:11 PM, Russell Jurney <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>>
wrote:I created call(String input) that calls call(String input, String path)
with default path. It fails with the same error as before: expected 2,
got
1.On Sunday, January 5, 2014, Matt Hayes wrote:
I think you should be able to have multiple constructors with
SimpleEvalFunc. You just can't have multiple overloaded call
implementations. You just need to ensure each calls super(). What is
the
problem you are having?
Reply to this email directly or view it on GitHub<
https://github.com/linkedin/datafu/issues/85#issuecomment-31614937>
.Russell Jurney twitter.com/rjurney [email protected]<javascript:_e({}, 'cvml', '[email protected]');>
datasyndrome.com
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31616199
.
Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com
from datafu.
Related Issues (20)
- Rename TimeCount to SessionCount HOT 1
- Merge BagConcat and BagUnion HOT 1
- Hourglass cannot handle joins where schemas are inconsistent HOT 1
- Hourglass fixed-length windows should be robust to reappearing data HOT 1
- Implement Entropy UDF HOT 10
- AliasableEvalFunc subcalss, how to test it? HOT 10
- Implement and experiment with different weighted sampling algorithms HOT 9
- Add datafu.pig.text package
- Can't run one unit test HOT 2
- Does it work with org.apache.pig.builtin.MonitoredUDF ? HOT 2
- Upgrade Pig library used to 0.12 HOT 1
- Add ToJson UDF to serialize any relation/field as a JSON String HOT 1
- datafu.pig.sampling.ReservoirSample HOT 5
- Hash UDFs should return zero-padded strings of uniform length even when leading bits are zero. HOT 2
- DistinctBy output is incorrect when any value in the tuple contains a '-' HOT 1
- Getting java.lang.NullPointerException in running PageRank HOT 1
- possible error in getting started with hourglass documentation HOT 1
- Release : When can we expect the 1.3 release of DataFu ? HOT 1
- Option to have Sessionize UDF spit out Long value instead of GUID HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datafu.