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
import org.apache.hadoop.hbase.HBaseConfiguration | |
import org.apache.hadoop.hbase.util.Bytes | |
import org.apache.hadoop.hbase.client.HTable | |
import org.apache.hadoop.hbase.client.Get | |
import org.apache.hadoop.io.Text | |
conf = HBaseConfiguration.new | |
tablename = "Customer" | |
table = HTable.new(conf, tablename) | |
get = Get.new(Bytes.toBytes('0001')) | |
data = table.get(get) |
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
import org.apache.hadoop.hbase.filter.CompareFilter | |
import org.apache.hadoop.hbase.filter.SingleColumnValueFilter | |
import org.apache.hadoop.hbase.filter.SubstringComparator | |
import org.apache.hadoop.hbase.util.Bytes | |
scan 't1', { COLUMNS => 'family:qualifier', FILTER => | |
SingleColumnValueFilter.new | |
(Bytes.toBytes('family'), | |
Bytes.toBytes('qualifier'), | |
CompareFilter::CompareOp.valueOf('EQUAL'), | |
SubstringComparator.new('somevalue')) |
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
0) Download avro-tools jar file from avro.apache.org | |
1) Extract Avro schema using avro-tools.jar | |
java -jar avro-tools*.jar getschema file.avro > file.avsc | |
2) Upload Avro schema to hdfs | |
hadoop fs -cp file.avsc /use/training/file.avsc |
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
-- This is a Hive program. Hive is an SQL-like language that compiles | |
-- into Hadoop Map/Reduce jobs. It's very popular among analysts at | |
-- Facebook, because it allows them to query enormous Hadoop data | |
-- stores using a language much like SQL. | |
-- Our logs are stored on the Hadoop Distributed File System, in the | |
-- directory /logs/randomhacks.net/access. They're ordinary Apache | |
-- logs in *.gz format. | |
-- | |
-- We want to pretend that these gzipped log files are a database table, |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd"> | |
<hook> | |
<portal-properties>portal.properties</portal-properties> | |
<struts-action> | |
<struts-action-path>/login/login</struts-action-path> | |
<struts-action-impl>com.test.CustomLoginAction</struts-action-impl> | |
</struts-action> |
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.test; | |
import javax.portlet.ActionRequest; | |
import javax.portlet.ActionResponse; | |
import javax.portlet.PortletConfig; | |
import javax.portlet.RenderRequest; | |
import javax.portlet.RenderResponse; | |
import com.liferay.portal.kernel.struts.BaseStrutsPortletAction; | |
import com.liferay.portal.kernel.struts.StrutsPortletAction; |
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
CREATE EXTERNAL TABLE GameDataAvro ( | |
… | |
) | |
ROW FORMAT SERDE ‘com.linkedin.haivvreo.AvroSerDe’ | |
STORED AS INPUTFORMAT ‘com.linkedin.haivvreo.AvroContainerInputFormat’ |
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
echo ruok | nc localhost 2181 |
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
a = LOAD 'hbase://Customer' using org.apache.pig.backend.hadoop.hbase.HBaseStorage('D:N','-loadKey=true') as (key:chararray,name:chararray); | |
b = order a by name parallel 1; | |
dump b; |
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
/* hadoop jar mysqlmapr.jar org.jm.samples.ComputeEnergyForCustomer -libjars /path/mysql-connector-java-5.1.13-bin.jar */ | |
package org.jm.samples; | |
import java.io.DataInput; | |
import java.io.DataOutput; | |
import java.io.IOException; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; |
OlderNewer