Skip to content

Commit

Permalink
committing
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Congiu committed Jul 24, 2014
2 parents 079471f + 8d96a3b commit 85827e0
Show file tree
Hide file tree
Showing 64 changed files with 2,282 additions and 257 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/target/
**/target/**
*.class

# Package Files #
*.jar
*.war
*.ear
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,29 @@ Features:
* Convert data to JSON format when INSERT INTO table
* arrays and maps are supported
* nested data structures are also supported.
* modular to support multiple versions of CDH

COMPILE
---------

Use maven to compile the serde.
The project uses maven profiles to support multiple
version of hive/CDH.
To build for CDH4:

```
mvn -Pcdh4 clean package
```

To build for CDH5:
```
mvn -Pcdh5 clean package
```






```bash
$ mvn package
Expand Down
57 changes: 57 additions & 0 deletions json-serde-cdh4-shim/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

<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">

<parent>
<groupId>org.openx.data</groupId>
<artifactId>json-serde-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>org.openx.data</groupId>
<artifactId>json-serde-cdh4-shim</artifactId>
<packaging>jar</packaging>

<name>json-cdh4-shim</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.openx.data</groupId>
<artifactId>json</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-serde</artifactId>
<version>${cdh4.hive.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${cdh4.hive.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${cdh4.hadoop.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>



Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*======================================================================*
* Copyright (c) 2011, OpenX Technologies, Inc. All rights reserved. *
* *
* Licensed under the New BSD License (the "License"); you may not use *
* this file except in compliance with the License. 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. See accompanying LICENSE file. *
*======================================================================*/


package org.openx.data.jsonserde.objectinspector.primitive;

import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry;

/**
*
* @author Roberto Congiu <[email protected]>
*/
public class TypeEntryShim {
public static PrimitiveTypeEntry byteType = PrimitiveObjectInspectorUtils.byteTypeEntry;
public static PrimitiveTypeEntry doubleType = PrimitiveObjectInspectorUtils.doubleTypeEntry;
public static PrimitiveTypeEntry floatType = PrimitiveObjectInspectorUtils.floatTypeEntry;
public static PrimitiveTypeEntry intType = PrimitiveObjectInspectorUtils.intTypeEntry;
public static PrimitiveTypeEntry longType = PrimitiveObjectInspectorUtils.longTypeEntry;
public static PrimitiveTypeEntry shortType = PrimitiveObjectInspectorUtils.shortTypeEntry;
public static PrimitiveTypeEntry timestampType = PrimitiveObjectInspectorUtils.timestampTypeEntry;
public static PrimitiveTypeEntry stringType = PrimitiveObjectInspectorUtils.stringTypeEntry;

}
59 changes: 59 additions & 0 deletions json-serde-cdh5-shim/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

<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">

<parent>
<groupId>org.openx.data</groupId>
<artifactId>json-serde-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>org.openx.data</groupId>
<artifactId>json-serde-cdh5-shim</artifactId>
<packaging>jar</packaging>

<name>json-cdh5-shim</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.openx.data</groupId>
<artifactId>json</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>


<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-serde</artifactId>
<version>${cdh5.hive.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${cdh5.hive.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${cdh5.hadoop.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>



Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*======================================================================*
* Copyright (c) 2011, OpenX Technologies, Inc. All rights reserved. *
* *
* Licensed under the New BSD License (the "License"); you may not use *
* this file except in compliance with the License. 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. See accompanying LICENSE file. *
*======================================================================*/

package org.openx.data.jsonserde.objectinspector.primitive;

import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;

/**
*
* @author Roberto Congiu <[email protected]>
*/
public class TypeEntryShim {
public static PrimitiveTypeInfo byteType = TypeInfoFactory.byteTypeInfo;
public static PrimitiveTypeInfo doubleType = TypeInfoFactory.doubleTypeInfo;
public static PrimitiveTypeInfo floatType = TypeInfoFactory.floatTypeInfo;
public static PrimitiveTypeInfo intType = TypeInfoFactory.intTypeInfo;
public static PrimitiveTypeInfo longType = TypeInfoFactory.longTypeInfo;
public static PrimitiveTypeInfo shortType = TypeInfoFactory.shortTypeInfo;
public static PrimitiveTypeInfo timestampType = TypeInfoFactory.timestampTypeInfo;
public static PrimitiveTypeInfo stringType = TypeInfoFactory.stringTypeInfo;
}
114 changes: 114 additions & 0 deletions json-serde/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

<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">

<parent>
<groupId>org.openx.data</groupId>
<artifactId>json-serde-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>org.openx.data</groupId>
<artifactId>json-serde</artifactId>
<packaging>jar</packaging>

<name>json-serde-main</name>


<build>
<!-- wagon-ssh-external extension is necessary for deploying with scpexe -->
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>2.2</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jgitflow-plugin</artifactId>
<version>1.0-alpha20</version>
<configuration>
<allowSnapshots>false</allowSnapshots>
<enableFeatureVersions>false</enableFeatureVersions>
<pushFeatures>false</pushFeatures>
<pushReleases>true</pushReleases>
<allowUntracked>true</allowUntracked>
<noDeploy>true</noDeploy>
</configuration>
</plugin>

<!-- Assembly Plugin -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>

</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.openx.data</groupId>
<artifactId>${serde.shim}</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.openx.data</groupId>
<artifactId>json</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>


<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-serde</artifactId>
<version>${cdh.hive.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${cdh.hive.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${cdh.hadoop.version}</version>
<scope>provided</scope>
</dependency>

</dependencies>
</project>



Loading

0 comments on commit 85827e0

Please sign in to comment.