Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 98430e0
Showing
5 changed files
with
490 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
target/ | ||
/var | ||
pom.xml.versionsBackup | ||
test-output/ | ||
/atlassian-ide-plugin.xml | ||
.idea | ||
.DS_Store | ||
.classpath | ||
.settings | ||
.project | ||
temp-testng-customsuite.xml | ||
test-output | ||
.externalToolBuilders | ||
*~ |
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,95 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.acz.hive</groupId> | ||
<artifactId>hive-serde</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>hive-serde</name> | ||
<url>https://github.com/electrum/hive-serde</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>cloudera-releases</id> | ||
<name>Cloudera Releases Repository</name> | ||
<url>https://repository.cloudera.com/content/repositories/releases/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>joda-time</groupId> | ||
<artifactId>joda-time</artifactId> | ||
<version>1.6.2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.codehaus.jackson</groupId> | ||
<artifactId>jackson-core-asl</artifactId> | ||
<version>1.8.5</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.codehaus.jackson</groupId> | ||
<artifactId>jackson-mapper-asl</artifactId> | ||
<version>1.8.5</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-core</artifactId> | ||
<version>0.20.2-cdh3u1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.hadoop.hive</groupId> | ||
<artifactId>hive-serde</artifactId> | ||
<version>0.7.1-cdh3u1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>6.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<configuration> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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,91 @@ | ||
package org.acz.hive.serde; | ||
|
||
import java.util.Collection; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class CaseInsensitiveMap<V> | ||
implements Map<String, V> | ||
{ | ||
Map<String, V> map = new HashMap<String, V>(); | ||
|
||
@Override | ||
public int size() | ||
{ | ||
return map.size(); | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() | ||
{ | ||
return map.isEmpty(); | ||
} | ||
|
||
@Override | ||
public boolean containsKey(Object key) | ||
{ | ||
return map.containsKey(convertKey(key)); | ||
} | ||
|
||
@Override | ||
public boolean containsValue(Object value) | ||
{ | ||
return map.containsValue(value); | ||
} | ||
|
||
@Override | ||
public V get(Object key) | ||
{ | ||
return map.get(convertKey(key)); | ||
} | ||
|
||
@Override | ||
public V remove(Object key) | ||
{ | ||
return map.remove(convertKey(key)); | ||
} | ||
|
||
@Override | ||
public void clear() | ||
{ | ||
map.clear(); | ||
} | ||
|
||
@Override | ||
public Set<String> keySet() | ||
{ | ||
throw new UnsupportedOperationException("keySet not supported"); | ||
} | ||
|
||
@Override | ||
public Collection<V> values() | ||
{ | ||
return map.values(); | ||
} | ||
|
||
@Override | ||
public Set<Entry<String, V>> entrySet() | ||
{ | ||
throw new UnsupportedOperationException("entrySet not supported"); | ||
} | ||
|
||
@Override | ||
public void putAll(Map<? extends String, ? extends V> m) | ||
{ | ||
for (Entry<? extends String, ? extends V> entry : m.entrySet()) { | ||
put(entry.getKey(), entry.getValue()); | ||
} | ||
} | ||
|
||
@Override | ||
public V put(String key, V value) | ||
{ | ||
return map.put(convertKey(key), value); | ||
} | ||
|
||
private static String convertKey(Object key) | ||
{ | ||
return ((String) key).toLowerCase(); | ||
} | ||
} |
Oops, something went wrong.