org.apache.hadoop.mapreduce.lib.join
Class Parser

java.lang.Object
  extended by org.apache.hadoop.mapreduce.lib.join.Parser

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class Parser
extends Object

Very simple shift-reduce parser for join expressions. This should be sufficient for the user extension permitted now, but ought to be replaced with a parser generator if more complex grammars are supported. In particular, this "shift-reduce" parser has no states. Each set of formals requires a different internal node type, which is responsible for interpreting the list of tokens it receives. This is sufficient for the current grammar, but it has several annoying properties that might inhibit extension. In particular, parenthesis are always function calls; an algebraic or filter grammar would not only require a node type, but must also work around the internals of this parser. For most other cases, adding classes to the hierarchy- particularly by extending JoinRecordReader and MultiFilterRecordReader- is fairly straightforward. One need only override the relevant method(s) (usually only CompositeRecordReader.combine(java.lang.Object[], org.apache.hadoop.mapreduce.lib.join.TupleWritable)) and include a property to map its value to an identifier in the parser.


Nested Class Summary
static class Parser.Node
           
static class Parser.NodeToken
           
static class Parser.NumToken
           
static class Parser.StrToken
           
static class Parser.Token
          Tagged-union type for tokens from the join expression.
static class Parser.TType
           
 
Constructor Summary
Parser()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.