additional dataset parsers

This commit is contained in:
MarkWolters 2023-11-29 16:49:54 -06:00
parent 9f1cd4015c
commit e80fc18fe4
3 changed files with 56 additions and 0 deletions

View File

@ -21,6 +21,10 @@ public interface DatasetParser {
switch(parsername) { switch(parsername) {
case "default": case "default":
return new DefaultDatasetParser(); return new DefaultDatasetParser();
case "noop":
return new NoopDatasetParser();
case "jaw":
return new JAWDatasetParser();
default: default:
throw new RuntimeException("Unknown parser name: " + parsername); throw new RuntimeException("Unknown parser name: " + parsername);
} }

View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.nosqlbench.datamappers.functions.hdf_to_cql;
public class JAWDatasetParser implements DatasetParser {
private static final String WHERE = "WHERE";
@Override
public String parse(String raw) {
if (!raw.toUpperCase().startsWith(WHERE)) {
raw = WHERE + " " + raw;
}
return raw;
}
}

View File

@ -0,0 +1,24 @@
/*
* Copyright (c) 2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.nosqlbench.datamappers.functions.hdf_to_cql;
public class NoopDatasetParser implements DatasetParser {
@Override
public String parse(String raw) {
return raw;
}
}