PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeTypedef.java

#
Java | 79 lines | 43 code | 14 blank | 22 comment | 0 complexity | 3c66737afa505ff95c73ac1c943a4b93 MD5 | raw file
 1/**
 2 * Licensed to the Apache Software Foundation (ASF) under one
 3 * or more contributor license agreements.  See the NOTICE file
 4 * distributed with this work for additional information
 5 * regarding copyright ownership.  The ASF licenses this file
 6 * to you under the Apache License, Version 2.0 (the
 7 * "License"); you may not use this file except in compliance
 8 * with the License.  You may obtain a copy of the License at
 9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19package org.apache.hadoop.hive.serde2.dynamic_type;
20
21import org.apache.hadoop.hive.serde2.SerDeException;
22import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
23import org.apache.thrift.TException;
24import org.apache.thrift.protocol.TProtocol;
25
26/**
27 * DynamicSerDeTypedef.
28 *
29 */
30public class DynamicSerDeTypedef extends DynamicSerDeTypeBase {
31
32  // production is: typedef DefinitionType() this.name
33
34  private static final int FD_DEFINITION_TYPE = 0;
35
36  public DynamicSerDeTypedef(int i) {
37    super(i);
38  }
39
40  public DynamicSerDeTypedef(thrift_grammar p, int i) {
41    super(p, i);
42  }
43
44  private DynamicSerDeSimpleNode getDefinitionType() {
45    return (DynamicSerDeSimpleNode) jjtGetChild(FD_DEFINITION_TYPE);
46  }
47
48  public DynamicSerDeTypeBase getMyType() {
49    DynamicSerDeSimpleNode child = getDefinitionType();
50    DynamicSerDeTypeBase ret = (DynamicSerDeTypeBase) child.jjtGetChild(0);
51    return ret;
52  }
53
54  @Override
55  public String toString() {
56    String result = "typedef " + name + "(";
57    result += getDefinitionType().toString();
58    result += ")";
59    return result;
60  }
61
62  @Override
63  public byte getType() {
64    throw new RuntimeException("not implemented");
65  }
66
67  @Override
68  public Object deserialize(Object reuse, TProtocol iprot)
69      throws SerDeException, TException, IllegalAccessException {
70    throw new RuntimeException("not implemented");
71  }
72
73  @Override
74  public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
75      throws TException, SerDeException, NoSuchFieldException, IllegalAccessException {
76    throw new RuntimeException("not implemented");
77  }
78
79}