This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/develop by this push:
new bda3a917 Extend some satisfy functions in every data type
corresponding Value Filter class so that accept other type as match object.
(#684)
bda3a917 is described below
commit bda3a917abdaccd1c1d575749635d37bd000b37e
Author: libo <[email protected]>
AuthorDate: Wed Dec 31 10:47:47 2025 +0800
Extend some satisfy functions in every data type corresponding Value Filter
class so that accept other type as match object. (#684)
---
.../src/main/codegen/templates/FilterTemplate.ftl | 62 +++++++++++++++++++++-
1 file changed, 61 insertions(+), 1 deletion(-)
diff --git a/java/tsfile/src/main/codegen/templates/FilterTemplate.ftl
b/java/tsfile/src/main/codegen/templates/FilterTemplate.ftl
index e42a0bca..34475fac 100644
--- a/java/tsfile/src/main/codegen/templates/FilterTemplate.ftl
+++ b/java/tsfile/src/main/codegen/templates/FilterTemplate.ftl
@@ -23,8 +23,9 @@ import static
org.apache.tsfile.utils.ReadWriteIOUtils.ClassSerializeId.${filter
import org.apache.tsfile.block.column.Column;
import org.apache.tsfile.read.common.block.TsBlock;
-<#if filter.dataType == "Binary">
+<#if filter.dataType == "Binary" || filter.dataType == "String">
import org.apache.tsfile.utils.Binary;
+import java.nio.charset.StandardCharsets;
</#if>
import org.apache.tsfile.utils.ReadWriteIOUtils;
@@ -66,6 +67,65 @@ public abstract class ${className} extends ValueFilter {
}
</#if>
+ <#if filter.dataType == "float">
+ @Override
+ public boolean satisfyInteger(long time, int value){
+ return satisfyFloat(time, value);
+ }
+ </#if>
+
+ <#if filter.dataType == "double">
+ @Override
+ public boolean satisfyInteger(long time, int value){
+ return satisfyDouble(time, value);
+ }
+
+ @Override
+ public boolean satisfyLong(long time, long value){
+ return satisfyDouble(time, value);
+ }
+
+ @Override
+ public boolean satisfyFloat(long time, float value){
+ return satisfyDouble(time, value);
+ }
+ </#if>
+
+ <#if filter.dataType == "String" || filter.dataType == "Binary">
+ @Override
+ public boolean satisfyInteger(long time, int value){
+ return satisfyBinary(time, new Binary(String.valueOf(value),
StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public boolean satisfyLong(long time, long value){
+ return satisfyBinary(time, new Binary(String.valueOf(value),
StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public boolean satisfyFloat(long time, float value){
+ return satisfyBinary(time, new Binary(String.valueOf(value),
StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public boolean satisfyDouble(long time, double value){
+ return satisfyBinary(time, new Binary(String.valueOf(value),
StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public boolean satisfyBoolean(long time, boolean value){
+ return satisfyBinary(time, new Binary(String.valueOf(value),
StandardCharsets.UTF_8));
+ }
+
+ <#if filter.javaBoxName == "Tag">
+ <#else>
+ @Override
+ public boolean satisfyString(long time, String value){
+ return satisfyBinary(time, new Binary(value, StandardCharsets.UTF_8));
+ }
+ </#if>
+ </#if>
+
@Override
public ClassSerializeId getClassSerializeId() {
return ${filter.classSerializeName};