Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://svn.apache.org/repos/asf/pig/trunk@1671956 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Jianyong Dai
committed
Apr 7, 2015
1 parent
af47535
commit 8af34f1
Showing
33 changed files
with
2,362 additions
and
710 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ache/hadoop/hive/serde2/objectinspector/primitive/JavaConstantBooleanObjectInspector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hadoop.hive.serde2.objectinspector.primitive; | ||
|
||
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; | ||
import org.apache.hadoop.io.BooleanWritable; | ||
|
||
/** | ||
* This class will be in Hive code base begin 1.2.0 (HIVE-9766). | ||
* Will remove once we switch to use Hive 1.2.0 | ||
*/ | ||
public class JavaConstantBooleanObjectInspector extends | ||
JavaBooleanObjectInspector implements ConstantObjectInspector { | ||
private Boolean value; | ||
|
||
public JavaConstantBooleanObjectInspector(Boolean value) { | ||
super(); | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public Object getWritableConstantValue() { | ||
if (value==null) { | ||
return null; | ||
} | ||
return new BooleanWritable(value); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...pache/hadoop/hive/serde2/objectinspector/primitive/JavaConstantDoubleObjectInspector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hadoop.hive.serde2.objectinspector.primitive; | ||
|
||
import org.apache.hadoop.hive.serde2.io.DoubleWritable; | ||
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; | ||
|
||
/** | ||
* This class will be in Hive code base begin 1.2.0 (HIVE-9766). | ||
* Will remove once we switch to use Hive 1.2.0 | ||
*/ | ||
public class JavaConstantDoubleObjectInspector extends | ||
JavaDoubleObjectInspector implements ConstantObjectInspector { | ||
private Double value; | ||
|
||
public JavaConstantDoubleObjectInspector(Double value) { | ||
super(); | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public Object getWritableConstantValue() { | ||
if (value==null) { | ||
return null; | ||
} | ||
return new DoubleWritable(value); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...apache/hadoop/hive/serde2/objectinspector/primitive/JavaConstantFloatObjectInspector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hadoop.hive.serde2.objectinspector.primitive; | ||
|
||
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; | ||
import org.apache.hadoop.io.FloatWritable; | ||
|
||
/** | ||
* This class will be in Hive code base begin 1.2.0 (HIVE-9766). | ||
* Will remove once we switch to use Hive 1.2.0 | ||
*/ | ||
public class JavaConstantFloatObjectInspector extends JavaFloatObjectInspector | ||
implements ConstantObjectInspector { | ||
private Float value; | ||
|
||
public JavaConstantFloatObjectInspector(Float value) { | ||
super(); | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public Object getWritableConstantValue() { | ||
if (value==null) { | ||
return null; | ||
} | ||
return new FloatWritable(value); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...g/apache/hadoop/hive/serde2/objectinspector/primitive/JavaConstantIntObjectInspector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hadoop.hive.serde2.objectinspector.primitive; | ||
|
||
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; | ||
import org.apache.hadoop.io.IntWritable; | ||
|
||
/** | ||
* This class will be in Hive code base begin 1.2.0 (HIVE-9766). | ||
* Will remove once we switch to use Hive 1.2.0 | ||
*/ | ||
public class JavaConstantIntObjectInspector extends JavaIntObjectInspector | ||
implements ConstantObjectInspector { | ||
private Integer value; | ||
|
||
public JavaConstantIntObjectInspector(Integer value) { | ||
super(); | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public Object getWritableConstantValue() { | ||
if (value==null) { | ||
return null; | ||
} | ||
return new IntWritable(value); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
.../apache/hadoop/hive/serde2/objectinspector/primitive/JavaConstantLongObjectInspector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hadoop.hive.serde2.objectinspector.primitive; | ||
|
||
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; | ||
import org.apache.hadoop.io.LongWritable; | ||
|
||
/** | ||
* This class will be in Hive code base begin 1.2.0 (HIVE-9766). | ||
* Will remove once we switch to use Hive 1.2.0 | ||
*/ | ||
public class JavaConstantLongObjectInspector extends JavaLongObjectInspector | ||
implements ConstantObjectInspector { | ||
private Long value; | ||
|
||
public JavaConstantLongObjectInspector(Long value) { | ||
super(); | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public Object getWritableConstantValue() { | ||
if (value==null) { | ||
return null; | ||
} | ||
return new LongWritable(value); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...pache/hadoop/hive/serde2/objectinspector/primitive/JavaConstantStringObjectInspector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hadoop.hive.serde2.objectinspector.primitive; | ||
|
||
/** | ||
* This class will be in Hive code base begin 1.2.0 (HIVE-9766). | ||
* Will remove once we switch to use Hive 1.2.0 | ||
*/ | ||
import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; | ||
import org.apache.hadoop.io.Text; | ||
|
||
public class JavaConstantStringObjectInspector extends | ||
JavaStringObjectInspector implements ConstantObjectInspector { | ||
private String value; | ||
|
||
public JavaConstantStringObjectInspector(String value) { | ||
super(); | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public Object getWritableConstantValue() { | ||
if (value==null) { | ||
return null; | ||
} | ||
return new Text(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ache/pig/backend/hadoop/executionengine/mapReduceLayer/UDFEndOfAllInputNeededVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.pig.backend.hadoop.executionengine.mapReduceLayer; | ||
|
||
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator; | ||
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc; | ||
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhyPlanVisitor; | ||
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan; | ||
import org.apache.pig.impl.plan.DependencyOrderWalker; | ||
import org.apache.pig.impl.plan.VisitorException; | ||
|
||
public class UDFEndOfAllInputNeededVisitor extends PhyPlanVisitor { | ||
|
||
private boolean needed = false; | ||
|
||
public UDFEndOfAllInputNeededVisitor(PhysicalPlan plan) { | ||
super(plan, new DependencyOrderWalker<PhysicalOperator, PhysicalPlan>(plan)); | ||
} | ||
|
||
@Override | ||
public void visitUserFunc(POUserFunc userFunc) throws VisitorException { | ||
super.visitUserFunc(userFunc); | ||
if (userFunc.needEndOfAllInputProcessing()) { | ||
needed = true; | ||
} | ||
} | ||
|
||
public boolean needEndOfAllInputProcessing() { | ||
return needed; | ||
} | ||
} |
Oops, something went wrong.