FAQ
Author: namit
Date: Thu Jul 12 05:05:58 2012
New Revision: 1360524

URL: http://svn.apache.org/viewvc?rev=1360524&view=rev
Log:
HIVE-2848 Add validation to HiveConf ConfVars
(Navis via namit)


Added:
hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation0.q
hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation1.q
hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation0.q.out
hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation1.q.out
Modified:
hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
hive/trunk/conf/hive-default.xml.template
hive/trunk/hbase-handler/src/test/results/negative/cascade_dbdrop.q.out
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
hive/trunk/ql/src/test/queries/clientpositive/udaf_context_ngrams.q
hive/trunk/ql/src/test/queries/clientpositive/udaf_ngrams.q
hive/trunk/ql/src/test/queries/clientpositive/udaf_percentile_approx.q
hive/trunk/ql/src/test/results/clientpositive/udaf_context_ngrams.q.out
hive/trunk/ql/src/test/results/clientpositive/udaf_ngrams.q.out
hive/trunk/ql/src/test/results/clientpositive/udaf_percentile_approx.q.out

Modified: hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
URL: http://svn.apache.org/viewvc/hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java (original)
+++ hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java Thu Jul 12 05:05:58 2012
@@ -59,6 +59,7 @@ import org.apache.hadoop.hive.ql.parse.P
import org.apache.hadoop.hive.ql.parse.VariableSubstitution;
import org.apache.hadoop.hive.ql.processors.CommandProcessor;
import org.apache.hadoop.hive.ql.processors.CommandProcessorFactory;
+import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse;
import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
import org.apache.hadoop.hive.service.HiveClient;
@@ -300,7 +301,12 @@ public class CliDriver {
if (ss.getIsVerbose()) {
ss.out.println(firstToken + " " + cmd_1);
}
- ret = proc.run(cmd_1).getResponseCode();
+ CommandProcessorResponse res = proc.run(cmd_1);
+ if (res.getResponseCode() != 0) {
+ ss.out.println("Query returned non-zero code: " + res.getResponseCode() +
+ ", cause: " + res.getErrorMessage());
+ }
+ ret = res.getResponseCode();
}
}
} catch (CommandNeedRetryException e) {

Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Thu Jul 12 05:05:58 2012
@@ -51,6 +51,8 @@ public class HiveConf extends Configurat
private static URL hiveSiteURL = null;
private static URL confVarURL = null;

+ private static final Map<String, ConfVars> vars = new HashMap<String, ConfVars>();
+
static {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
@@ -71,6 +73,9 @@ public class HiveConf extends Configurat
} else {
l4j.debug("Using hive-site.xml found on CLASSPATH at " + hiveSiteURL.getPath());
}
+ for (ConfVars confVar : ConfVars.values()) {
+ vars.put(confVar.varname, confVar);
+ }
}

/**
@@ -536,6 +541,8 @@ public class HiveConf extends Configurat
HIVEVARIABLESUBSTITUTE("hive.variable.substitute", true),
HIVEVARIABLESUBSTITUTEDEPTH("hive.variable.substitute.depth", 40),

+ HIVECONFVALIDATION("hive.conf.validation", true),
+
SEMANTIC_ANALYZER_HOOK("hive.semantic.analyzer.hook", ""),

HIVE_AUTHORIZATION_ENABLED("hive.security.authorization.enabled", false),
@@ -600,6 +607,8 @@ public class HiveConf extends Configurat
public final Class<?> valClass;
public final boolean defaultBoolVal;

+ private final VarType type;
+
ConfVars(String varname, String defaultVal) {
this.varname = varname;
this.valClass = String.class;
@@ -608,6 +617,7 @@ public class HiveConf extends Configurat
this.defaultLongVal = -1;
this.defaultFloatVal = -1;
this.defaultBoolVal = false;
+ this.type = VarType.STRING;
}

ConfVars(String varname, int defaultIntVal) {
@@ -618,6 +628,7 @@ public class HiveConf extends Configurat
this.defaultLongVal = -1;
this.defaultFloatVal = -1;
this.defaultBoolVal = false;
+ this.type = VarType.INT;
}

ConfVars(String varname, long defaultLongVal) {
@@ -628,6 +639,7 @@ public class HiveConf extends Configurat
this.defaultLongVal = defaultLongVal;
this.defaultFloatVal = -1;
this.defaultBoolVal = false;
+ this.type = VarType.LONG;
}

ConfVars(String varname, float defaultFloatVal) {
@@ -638,6 +650,7 @@ public class HiveConf extends Configurat
this.defaultLongVal = -1;
this.defaultFloatVal = defaultFloatVal;
this.defaultBoolVal = false;
+ this.type = VarType.FLOAT;
}

ConfVars(String varname, boolean defaultBoolVal) {
@@ -648,6 +661,15 @@ public class HiveConf extends Configurat
this.defaultLongVal = -1;
this.defaultFloatVal = -1;
this.defaultBoolVal = defaultBoolVal;
+ this.type = VarType.BOOLEAN;
+ }
+
+ public boolean isType(String value) {
+ return type.isType(value);
+ }
+
+ public String typeString() {
+ return type.typeString();
}

@Override
@@ -665,6 +687,21 @@ public class HiveConf extends Configurat
return (val == null ? File.separator + "usr" : val)
+ File.separator + "bin" + File.separator + "hadoop";
}
+
+ enum VarType {
+ STRING { void checkType(String value) throws Exception { } },
+ INT { void checkType(String value) throws Exception { Integer.valueOf(value); } },
+ LONG { void checkType(String value) throws Exception { Long.valueOf(value); } },
+ FLOAT { void checkType(String value) throws Exception { Float.valueOf(value); } },
+ BOOLEAN { void checkType(String value) throws Exception { Boolean.valueOf(value); } };
+
+ boolean isType(String value) {
+ try { checkType(value); } catch (Exception e) { return false; }
+ return true;
+ }
+ String typeString() { return name().toUpperCase();}
+ abstract void checkType(String value) throws Exception;
+ }
}

/**
@@ -797,6 +834,10 @@ public class HiveConf extends Configurat
conf.set(var.varname, val);
}

+ public static ConfVars getConfVars(String name) {
+ return vars.get(name);
+ }
+
public String getVar(ConfVars var) {
return getVar(this, var);
}

Modified: hive/trunk/conf/hive-default.xml.template
URL: http://svn.apache.org/viewvc/hive/trunk/conf/hive-default.xml.template?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/conf/hive-default.xml.template (original)
+++ hive/trunk/conf/hive-default.xml.template Thu Jul 12 05:05:58 2012
@@ -1044,6 +1044,12 @@
</property>

<property>
+ <name>hive.conf.validation</name>
+ <value>true</value>
+ <description>Eables type checking for registered hive configurations</description>
+</property>
+
+<property>
<name>hive.security.authorization.enabled</name>
<value>false</value>
<description>enable or disable the hive client authorization</description>

Modified: hive/trunk/hbase-handler/src/test/results/negative/cascade_dbdrop.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/hbase-handler/src/test/results/negative/cascade_dbdrop.q.out?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/hbase-handler/src/test/results/negative/cascade_dbdrop.q.out (original)
+++ hive/trunk/hbase-handler/src/test/results/negative/cascade_dbdrop.q.out Thu Jul 12 05:05:58 2012
@@ -20,3 +20,4 @@ PREHOOK: type: DROPDATABASE
POSTHOOK: query: DROP DATABASE IF EXISTS hbaseDB CASCADE
POSTHOOK: type: DROPDATABASE
Command failed with exit code = -1
+Query returned non-zero code: -1, cause: null

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java Thu Jul 12 05:05:58 2012
@@ -27,8 +27,9 @@ import java.util.Properties;
import java.util.SortedMap;
import java.util.TreeMap;

-import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.Schema;
+import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.ql.parse.VariableSubstitution;
import org.apache.hadoop.hive.ql.session.SessionState;

@@ -112,18 +113,37 @@ public class SetProcessor implements Com
return new CommandProcessorResponse(0);
} else if (varname.startsWith(SetProcessor.HIVECONF_PREFIX)){
String propName = varname.substring(SetProcessor.HIVECONF_PREFIX.length());
- ss.getConf().set(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue));
- return new CommandProcessorResponse(0);
+ String error = setConf(varname, propName, varvalue, false);
+ return new CommandProcessorResponse(error == null ? 0 : 1, error, null);
} else if (varname.startsWith(SetProcessor.HIVEVAR_PREFIX)) {
String propName = varname.substring(SetProcessor.HIVEVAR_PREFIX.length());
ss.getHiveVariables().put(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue));
return new CommandProcessorResponse(0);
} else {
- String substitutedValue = new VariableSubstitution().substitute(ss.getConf(),varvalue);
- ss.getConf().set(varname, substitutedValue );
- ss.getOverriddenConfigurations().put(varname, substitutedValue);
- return new CommandProcessorResponse(0);
+ String error = setConf(varname, varname, varvalue, true);
+ return new CommandProcessorResponse(error == null ? 0 : 1, error, null);
+ }
+ }
+
+ // returns non-null string for validation fail
+ private String setConf(String varname, String key, String varvalue, boolean register) {
+ HiveConf conf = SessionState.get().getConf();
+ String value = new VariableSubstitution().substitute(conf, varvalue);
+ if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) {
+ HiveConf.ConfVars confVars = HiveConf.getConfVars(key);
+ if (confVars != null && !confVars.isType(value)) {
+ StringBuilder message = new StringBuilder();
+ message.append("'SET ").append(varname).append('=').append(varvalue);
+ message.append("' FAILED because "); message.append(key).append(" expects an ");
+ message.append(confVars.typeString()).append(" value.");
+ return message.toString();
+ }
+ }
+ conf.set(key, value);
+ if (register) {
+ SessionState.get().getOverriddenConfigurations().put(key, value);
}
+ return null;
}

private SortedMap<String,String> propertiesToSortedMap(Properties p){

Added: hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation0.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation0.q?rev=1360524&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation0.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation0.q Thu Jul 12 05:05:58 2012
@@ -0,0 +1,5 @@
+-- should fail: hive.join.cache.size accepts int type
+desc src;
+
+set hive.conf.validation=true;
+set hive.join.cache.size=test;

Added: hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation1.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation1.q?rev=1360524&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation1.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/set_hiveconf_validation1.q Thu Jul 12 05:05:58 2012
@@ -0,0 +1,5 @@
+-- should fail: hive.map.aggr.hash.min.reduction accepts float type
+desc src;
+
+set hive.conf.validation=true;
+set hive.map.aggr.hash.min.reduction=false;

Modified: hive/trunk/ql/src/test/queries/clientpositive/udaf_context_ngrams.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/udaf_context_ngrams.q?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/udaf_context_ngrams.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/udaf_context_ngrams.q Thu Jul 12 05:05:58 2012
@@ -1,7 +1,7 @@
CREATE TABLE kafka (contents STRING);
LOAD DATA LOCAL INPATH '../data/files/text-en.txt' INTO TABLE kafka;
-set mapred.reduce.tasks=1
-set hive.exec.reducers.max=1
+set mapred.reduce.tasks=1;
+set hive.exec.reducers.max=1;

SELECT context_ngrams(sentences(lower(contents)), array(null), 100, 1000).estfrequency FROM kafka;
SELECT context_ngrams(sentences(lower(contents)), array("he",null), 100, 1000) FROM kafka;

Modified: hive/trunk/ql/src/test/queries/clientpositive/udaf_ngrams.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/udaf_ngrams.q?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/udaf_ngrams.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/udaf_ngrams.q Thu Jul 12 05:05:58 2012
@@ -1,7 +1,7 @@
CREATE TABLE kafka (contents STRING);
LOAD DATA LOCAL INPATH '../data/files/text-en.txt' INTO TABLE kafka;
-set mapred.reduce.tasks=1
-set hive.exec.reducers.max=1
+set mapred.reduce.tasks=1;
+set hive.exec.reducers.max=1;

SELECT ngrams(sentences(lower(contents)), 1, 100, 1000).estfrequency FROM kafka;
SELECT ngrams(sentences(lower(contents)), 2, 100, 1000).estfrequency FROM kafka;

Modified: hive/trunk/ql/src/test/queries/clientpositive/udaf_percentile_approx.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/udaf_percentile_approx.q?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/udaf_percentile_approx.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/udaf_percentile_approx.q Thu Jul 12 05:05:58 2012
@@ -1,6 +1,6 @@

-set mapred.reduce.tasks=4
-set hive.exec.reducers.max=4
+set mapred.reduce.tasks=4;
+set hive.exec.reducers.max=4;
SELECT percentile_approx(cast(substr(src.value,5) AS double), 0.5) FROM src;
SELECT percentile_approx(cast(substr(src.value,5) AS double), 0.5, 100) FROM src;
SELECT percentile_approx(cast(substr(src.value,5) AS double), 0.5, 1000) FROM src;

Added: hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation0.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation0.q.out?rev=1360524&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation0.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation0.q.out Thu Jul 12 05:05:58 2012
@@ -0,0 +1,9 @@
+PREHOOK: query: -- should fail: hive.join.cache.size accepts int type
+desc src
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: -- should fail: hive.join.cache.size accepts int type
+desc src
+POSTHOOK: type: DESCTABLE
+key string default
+value string default
+Query returned non-zero code: 1, cause: 'SET hive.join.cache.size=test' FAILED because hive.join.cache.size expects an INT value.

Added: hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation1.q.out?rev=1360524&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation1.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/set_hiveconf_validation1.q.out Thu Jul 12 05:05:58 2012
@@ -0,0 +1,9 @@
+PREHOOK: query: -- should fail: hive.map.aggr.hash.min.reduction accepts float type
+desc src
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: -- should fail: hive.map.aggr.hash.min.reduction accepts float type
+desc src
+POSTHOOK: type: DESCTABLE
+key string default
+value string default
+Query returned non-zero code: 1, cause: 'SET hive.map.aggr.hash.min.reduction=false' FAILED because hive.map.aggr.hash.min.reduction expects an FLOAT value.

Modified: hive/trunk/ql/src/test/results/clientpositive/udaf_context_ngrams.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/udaf_context_ngrams.q.out?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/udaf_context_ngrams.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/udaf_context_ngrams.q.out Thu Jul 12 05:05:58 2012
@@ -9,6 +9,15 @@ PREHOOK: Output: default@kafka
POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/text-en.txt' INTO TABLE kafka
POSTHOOK: type: LOAD
POSTHOOK: Output: default@kafka
+PREHOOK: query: SELECT context_ngrams(sentences(lower(contents)), array(null), 100, 1000).estfrequency FROM kafka
+PREHOOK: type: QUERY
+PREHOOK: Input: default@kafka
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT context_ngrams(sentences(lower(contents)), array(null), 100, 1000).estfrequency FROM kafka
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@kafka
+#### A masked pattern was here ####
+[267.0,171.0,164.0,119.0,108.0,106.0,106.0,82.0,79.0,67.0,67.0,46.0,45.0,42.0,42.0,40.0,39.0,37.0,37.0,36.0,34.0,32.0,32.0,30.0,30.0,29.0,28.0,28.0,28.0,28.0,26.0,25.0,24.0,23.0,23.0,22.0,22.0,21.0,20.0,19.0,18.0,18.0,18.0,17.0,17.0,17.0,16.0,16.0,16.0,16.0,15.0,15.0,14.0,14.0,14.0,13.0,13.0,13.0,13.0,13.0,13.0,13.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,11.0,11.0,11.0,11.0,11.0,11.0,11.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,8.0]
PREHOOK: query: SELECT context_ngrams(sentences(lower(contents)), array("he",null), 100, 1000) FROM kafka
PREHOOK: type: QUERY
PREHOOK: Input: default@kafka

Modified: hive/trunk/ql/src/test/results/clientpositive/udaf_ngrams.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/udaf_ngrams.q.out?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/udaf_ngrams.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/udaf_ngrams.q.out Thu Jul 12 05:05:58 2012
@@ -9,6 +9,15 @@ PREHOOK: Output: default@kafka
POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/text-en.txt' INTO TABLE kafka
POSTHOOK: type: LOAD
POSTHOOK: Output: default@kafka
+PREHOOK: query: SELECT ngrams(sentences(lower(contents)), 1, 100, 1000).estfrequency FROM kafka
+PREHOOK: type: QUERY
+PREHOOK: Input: default@kafka
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT ngrams(sentences(lower(contents)), 1, 100, 1000).estfrequency FROM kafka
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@kafka
+#### A masked pattern was here ####
+[267.0,171.0,164.0,119.0,108.0,106.0,106.0,82.0,79.0,67.0,67.0,46.0,45.0,42.0,42.0,40.0,39.0,37.0,37.0,36.0,34.0,32.0,32.0,30.0,30.0,29.0,28.0,28.0,28.0,28.0,26.0,25.0,24.0,23.0,23.0,22.0,22.0,21.0,20.0,19.0,18.0,18.0,18.0,17.0,17.0,17.0,16.0,16.0,16.0,16.0,15.0,15.0,14.0,14.0,14.0,13.0,13.0,13.0,13.0,13.0,13.0,13.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,11.0,11.0,11.0,11.0,11.0,11.0,11.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,9.0,8.0]
PREHOOK: query: SELECT ngrams(sentences(lower(contents)), 2, 100, 1000).estfrequency FROM kafka
PREHOOK: type: QUERY
PREHOOK: Input: default@kafka

Modified: hive/trunk/ql/src/test/results/clientpositive/udaf_percentile_approx.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/udaf_percentile_approx.q.out?rev=1360524&r1=1360523&r2=1360524&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/udaf_percentile_approx.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/udaf_percentile_approx.q.out Thu Jul 12 05:05:58 2012
@@ -1,3 +1,12 @@
+PREHOOK: query: SELECT percentile_approx(cast(substr(src.value,5) AS double), 0.5) FROM src
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT percentile_approx(cast(substr(src.value,5) AS double), 0.5) FROM src
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+255.5
PREHOOK: query: SELECT percentile_approx(cast(substr(src.value,5) AS double), 0.5, 100) FROM src
PREHOOK: type: QUERY
PREHOOK: Input: default@src

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJul 12, '12 at 5:06a
activeJul 12, '12 at 5:06a
posts1
users1
websitehive.apache.org

1 user in discussion

Namit: 1 post

People

Translate

site design / logo © 2021 Grokbase