hiveService/src/main/java/com/ge/research/semtk/edc/services/hive/HiveServiceRestController.java
@CrossOrigin
	@RequestMapping(value="/rowFilter", method= RequestMethod.POST)
	public JSONObject rowFilter(@RequestBody HiveServiceRowFilterRequestBody requestBody){

		String whereClause = "";
		for (ColumnFilter co : requestBody.columnFilters) {
			String operation = null;
			String op = co.operation;
			if (op == null)
				op = "";
			op = op.toLowerCase ();
			switch (op) {
				case "gt":	operation = ">";
						break;
				case "lt":	operation = "<";
						break;
				case "gte":	operation = ">=";
						break;
				case "lte":	operation = "<=";
						break;
				case "eq": operation = "=";
						break;
				default:	TableResultSet tableResultSet = new TableResultSet();
						tableResultSet.setSuccess(false);
						tableResultSet.addRationaleMessage("Unknown operation: " + co.operation + ".\n  Valid options are: min, max, avg, sum, variance, and stddev.");
						return tableResultSet.toJson();
			}
			if (!whereClause.equals (""))
				whereClause += " and ";
			String col = co.column;
			if (!co.type.toLowerCase().equalsIgnoreCase("string"))
				col = "cast(" + col + " as " + co.type + ")";
			whereClause += col + " " + operation + " " + co.value;
		}

		String query = "select S.* from " + requestBody.table + " S  where " + whereClause;
		return runQuery (requestBody, query);
	}
/**
	 * Execute row filter query on one or more columns in Hive
	 */
Execute row filter query on one or more columns in Hive
Execute row filter query on one or more columns in Hive
@CrossOrigin
	@RequestMapping(value="/rowFilter", method= RequestMethod.POST)
	public JSONObject rowFilter(@RequestBody HiveServiceRowFilterRequestBody requestBody){
		String whereClause = "";
		for (ColumnFilter co : requestBody.columnFilters) {
			String operation = null;
			String op = co.operation;
			if (op == null)
				op = "";
			op = op.toLowerCase ();
			switch (op) {
				case "gt":	operation = ">";
						break;
				case "lt":	operation = "<";
						break;
				case "gte":	operation = ">=";
						break;
				case "lte":	operation = "<=";
						break;
				case "eq": operation = "=";
						break;
				default:	TableResultSet tableResultSet = new TableResultSet();
						tableResultSet.setSuccess(false);
						tableResultSet.addRationaleMessage("Unknown operation: " + co.operation + ".\n  Valid options are: min, max, avg, sum, variance, and stddev.");
						return tableResultSet.toJson();
			}
			if (!whereClause.equals (""))
				whereClause += " and ";
			String col = co.column;
			if (!co.type.toLowerCase().equalsIgnoreCase("string"))
				col = "cast(" + col + " as " + co.type + ")";
			whereClause += col + " " + operation + " " + co.value;
		}
		String query = "select S.* from " + requestBody.table + " S  where " + whereClause;
		return runQuery (requestBody, query);
	}
@ CrossOrigin @ RequestMapping ( value = "/rowFilter" , method = RequestMethod . POST ) public JSONObject rowFilter ( @ RequestBody HiveServiceRowFilterRequestBody requestBody ) { String whereClause = "" ; for ( ColumnFilter co : requestBody . columnFilters ) { String operation = null ; String op = co . operation ; if ( op == null ) op = "" ; op = op . toLowerCase ( ) ; switch ( op ) { case "gt" : operation = ">" ; break ; case "lt" : operation = "<" ; break ; case "gte" : operation = ">=" ; break ; case "lte" : operation = "<=" ; break ; case "eq" : operation = "=" ; break ; default : TableResultSet tableResultSet = new TableResultSet ( ) ; tableResultSet . setSuccess ( false ) ; tableResultSet . addRationaleMessage ( "Unknown operation: " + co . operation + ".\n  Valid options are: min, max, avg, sum, variance, and stddev." ) ; return tableResultSet . toJson ( ) ; } if ( ! whereClause . equals ( "" ) ) whereClause += " and " ; String col = co . column ; if ( ! co . type . toLowerCase ( ) . equalsIgnoreCase ( "string" ) ) col = "cast(" + col + " as " + co . type + ")" ; whereClause += col + " " + operation + " " + co . value ; } String query = "select S.* from " + requestBody . table + " S  where " + whereClause ; return runQuery ( requestBody , query ) ; }
Execute row filter query on one or more columns in Hive
Execute row filter query on one or more columns in Hive