Removed unused predicate deserialization code.
@@ -430,54 +430,4 @@ public class PredicateInfo {
throw new RuntimeException("Could not create prepared statement from (" + sql + ").", ex);
}
}
-
- /**
- * Construct a predicate given a specific table.
- * If this table is not actually a predicate table, the null will be returned.
- */
- private static StandardPredicate createPredicateFromTable(Connection connection, String tableName, String name) {
- Pattern argumentPattern = Pattern.compile("(\\w+)_(\\d)");
-
- try (ResultSet resultSet = connection.getMetaData().getColumns(null, null, tableName, null)) {
- ArrayList<ConstantType> args = new ArrayList<ConstantType>();
-
- boolean hasPartitionColumn = false;
- boolean hasValueColumn = false;
-
- while (resultSet.next()) {
- String columnName = resultSet.getString("COLUMN_NAME");
-
- Matcher match = argumentPattern.matcher(columnName);
- if (columnName.equalsIgnoreCase(PredicateInfo.PARTITION_COLUMN_NAME)) {
- hasPartitionColumn = true;
- } else if (columnName.equalsIgnoreCase(PredicateInfo.VALUE_COLUMN_NAME)) {
- hasValueColumn = true;
- } else if (match.find()) {
- String argumentName = match.group(1).toLowerCase();
- int argumentLocation = Integer.parseInt(match.group(2));
-
- if (argumentName.equals("string")) {
- args.add(argumentLocation, ConstantType.String);
- } else if (argumentName.equals("integer")) {
- args.add(argumentLocation, ConstantType.Integer);
- } else if (argumentName.equals("double")) {
- args.add(argumentLocation, ConstantType.Double);
- } else if (argumentName.equals("uniqueintid")) {
- args.add(argumentLocation, ConstantType.UniqueIntID);
- } else if (argumentName.equals("uniquestringid")) {
- args.add(argumentLocation, ConstantType.UniqueStringID);
- }
- }
- }
-
- // Check if we found all the required columns and some argument columns were found.
- if (!hasPartitionColumn || !hasValueColumn || args.size() == 0) {
- return null;
- }
-
- return StandardPredicate.get(name, args.toArray(new ConstantType[args.size()]));
- } catch (SQLException ex) {
- throw new RuntimeException("Failed to create predicate (" + name + ") from table (" + tableName + ").", ex);
- }
- }
}
