PageRenderTime 43ms CodeModel.GetById 18ms 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
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  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. package org.apache.hadoop.hive.serde2.dynamic_type;
  19. import org.apache.hadoop.hive.serde2.SerDeException;
  20. import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
  21. import org.apache.thrift.TException;
  22. import org.apache.thrift.protocol.TProtocol;
  23. /**
  24. * DynamicSerDeTypedef.
  25. *
  26. */
  27. public class DynamicSerDeTypedef extends DynamicSerDeTypeBase {
  28. // production is: typedef DefinitionType() this.name
  29. private static final int FD_DEFINITION_TYPE = 0;
  30. public DynamicSerDeTypedef(int i) {
  31. super(i);
  32. }
  33. public DynamicSerDeTypedef(thrift_grammar p, int i) {
  34. super(p, i);
  35. }
  36. private DynamicSerDeSimpleNode getDefinitionType() {
  37. return (DynamicSerDeSimpleNode) jjtGetChild(FD_DEFINITION_TYPE);
  38. }
  39. public DynamicSerDeTypeBase getMyType() {
  40. DynamicSerDeSimpleNode child = getDefinitionType();
  41. DynamicSerDeTypeBase ret = (DynamicSerDeTypeBase) child.jjtGetChild(0);
  42. return ret;
  43. }
  44. @Override
  45. public String toString() {
  46. String result = "typedef " + name + "(";
  47. result += getDefinitionType().toString();
  48. result += ")";
  49. return result;
  50. }
  51. @Override
  52. public byte getType() {
  53. throw new RuntimeException("not implemented");
  54. }
  55. @Override
  56. public Object deserialize(Object reuse, TProtocol iprot)
  57. throws SerDeException, TException, IllegalAccessException {
  58. throw new RuntimeException("not implemented");
  59. }
  60. @Override
  61. public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
  62. throws TException, SerDeException, NoSuchFieldException, IllegalAccessException {
  63. throw new RuntimeException("not implemented");
  64. }
  65. }