コード例 #1
0
 public TDropFunctionParams toThrift() {
   TDropFunctionParams params = new TDropFunctionParams();
   params.setFn_name(desc_.getFunctionName().toThrift());
   params.setArg_types(PrimitiveType.toThrift(desc_.getArgs()));
   params.setIf_exists(getIfExists());
   return params;
 }
コード例 #2
0
ファイル: DateLiteral.java プロジェクト: nlalevee/impala
 /**
  * C'tor takes string because a DateLiteral can only be constructed by an implicit cast Parsing
  * will only succeed if all characters of s are accepted.
  *
  * @param s string representation of date
  * @param type desired type of date literal
  */
 public DateLiteral(String s, PrimitiveType type) throws AnalysisException {
   Preconditions.checkArgument(type.isDateType());
   Date date = null;
   ParsePosition pos = new ParsePosition(0);
   for (SimpleDateFormat format : formats) {
     pos.setIndex(0);
     date = format.parse(s, pos);
     if (pos.getIndex() == s.length()) {
       acceptedFormat = format;
       break;
     }
   }
   if (acceptedFormat == null) {
     throw new AnalysisException("Unable to parse string '" + s + "' to date.");
   }
   this.value = new Timestamp(date.getTime());
   this.type = type;
 }