This file contains hidden or 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
package com.rishav.hadoop.hive.ql.udf.generic; | |
import java.util.ArrayList; | |
import org.apache.hadoop.hive.ql.exec.Description; | |
import org.apache.hadoop.hive.ql.exec.UDFArgumentException; | |
import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException; | |
import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException; | |
import org.apache.hadoop.hive.ql.metadata.HiveException; | |
import org.apache.hadoop.hive.ql.udf.UDFType; |
This file contains hidden or 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
package com.rishav.hadoop.hive.ql.udf.utils; | |
import java.io.IOException; | |
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; | |
import org.apache.commons.httpclient.HttpClient; | |
import org.apache.commons.httpclient.HttpException; | |
import org.apache.commons.httpclient.HttpStatus; | |
import org.apache.commons.httpclient.URIException; | |
import org.apache.commons.httpclient.methods.GetMethod; |
This file contains hidden or 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
package com.rishav.hbase.union; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.conf.Configured; | |
import org.apache.hadoop.hbase.client.Scan; | |
import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil; | |
import org.apache.hadoop.hbase.util.Bytes; |
This file contains hidden or 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
package com.rishav.hbase.union; | |
import java.io.IOException; | |
import org.apache.hadoop.hbase.client.Put; | |
import org.apache.hadoop.hbase.io.ImmutableBytesWritable; | |
import org.apache.hadoop.hbase.mapreduce.TableReducer; | |
import org.apache.hadoop.hbase.util.Bytes; |
This file contains hidden or 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
package com.rishav.hbase.union; | |
import java.util.Arrays; | |
import org.apache.hadoop.hbase.client.Result; | |
import org.apache.hadoop.hbase.io.ImmutableBytesWritable; | |
import org.apache.hadoop.hbase.mapreduce.TableMapper; | |
import org.apache.hadoop.hbase.mapreduce.TableSplit; | |
import org.apache.hadoop.hbase.util.Bytes; |
This file contains hidden or 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
/** | |
* Autogenerated by Avro | |
* | |
* DO NOT EDIT DIRECTLY | |
*/ | |
package com.rishav.avro; | |
@SuppressWarnings("all") | |
@org.apache.avro.specific.AvroGenerated | |
public class student_marks extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { | |
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"student_marks\",\"namespace\":\"com.rishav.avro\",\"fields\":[{\"name\":\"student_id\",\"type\":\"int\"},{\"name\":\"subject_id\",\"type\":\"int\"},{\"name\":\"marks\",\"type\":\"int\"}]}"); |
This file contains hidden or 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
public class UpdateMongoBatchId { | |
public static void main(String[] args) { | |
Integer batchId = new Integer(args[0]); | |
try { | |
Mongo mongo = new Mongo("10.x.x.x", 27017); | |
DB db = mongo.getDB("dbname"); | |
DBCollection coll1 = db.getCollection("collname"); | |
// MongoDB find conditions |
This file contains hidden or 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
package com.rishav.avro.mapreduce; | |
import java.io.IOException; | |
import org.apache.avro.Schema; | |
import org.apache.avro.mapred.AvroKey; | |
import org.apache.avro.mapred.AvroValue; | |
import org.apache.avro.mapreduce.AvroJob; | |
import org.apache.avro.mapreduce.AvroKeyInputFormat; | |
import org.apache.avro.mapreduce.AvroKeyValueOutputFormat; | |
import org.apache.hadoop.conf.Configured; |
This file contains hidden or 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
--1. Create a Hive table stored as textfile | |
USE test; | |
CREATE TABLE csv_table ( | |
student_id INT, | |
subject_id INT, | |
marks INT) | |
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' | |
STORED AS TEXTFILE; | |
--2. Load csv_table with student.csv data |
This file contains hidden or 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
package com.hadoop.imcdp; | |
import java.io.*; | |
import java.util.Set; | |
import java.lang.Integer; | |
import org.apache.hadoop.io.*; | |
public class IntPair implements WritableComparable<IntPair>{ | |
private IntWritable first; |
NewerOlder