From e8d124b9d96a3b52a57edfa25604a20069e679f0 Mon Sep 17 00:00:00 2001 From: Na Lee Ha Date: Mon, 22 Jan 2024 18:45:59 +0000 Subject: [PATCH] #989 applying sql filter on the virutalised table using ignite example --- .../data/order/ignite/IgniteOrderStore.scala | 2 +- .../provider/IgniteOrderDataProvider.scala | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/data-ignite/src/main/scala/org/finos/vuu/data/order/ignite/IgniteOrderStore.scala b/example/data-ignite/src/main/scala/org/finos/vuu/data/order/ignite/IgniteOrderStore.scala index a80d7824b..f472b3509 100644 --- a/example/data-ignite/src/main/scala/org/finos/vuu/data/order/ignite/IgniteOrderStore.scala +++ b/example/data-ignite/src/main/scala/org/finos/vuu/data/order/ignite/IgniteOrderStore.scala @@ -73,7 +73,7 @@ class IgniteOrderStore(private val parentOrderCache: IgniteCache[Int, ParentOrde counter += 1 }) - logger.info(s"Loaded Ignite ChildOrder for $counter rows, from index : $startIndex") + logger.info(s"Loaded Ignite ChildOrder for $counter rows, from index : $startIndex where $whereClause") buffer diff --git a/example/virtualized-table/src/main/scala/org/finos/vuu/example/virtualtable/provider/IgniteOrderDataProvider.scala b/example/virtualized-table/src/main/scala/org/finos/vuu/example/virtualtable/provider/IgniteOrderDataProvider.scala index 7484b599c..fc1c0d2ed 100644 --- a/example/virtualized-table/src/main/scala/org/finos/vuu/example/virtualtable/provider/IgniteOrderDataProvider.scala +++ b/example/virtualized-table/src/main/scala/org/finos/vuu/example/virtualtable/provider/IgniteOrderDataProvider.scala @@ -24,17 +24,17 @@ class IgniteOrderDataProvider(final val igniteStore: IgniteOrderStore)(implicit internalTable.setRange(VirtualizedRange(range.from, range.to)) -// val sqlFilterClause = -// if (viewPort.filterSpec.filter == null || viewPort.filterSpec.filter.isEmpty) { -// "" -// } -// else { -// val filterTreeVisitor = new IgniteSqlFilterTreeVisitor -// val clause = FilterSpecParser.parse[IgniteSqlFilterClause](viewPort.filterSpec.filter, filterTreeVisitor) -// clause.toSql() -// } - - val sqlFilterClause = "" + val sqlFilterClause = + if (viewPort.filterSpec.filter == null || viewPort.filterSpec.filter.isEmpty) { + "" + } + else { + val filterTreeVisitor = new IgniteSqlFilterTreeVisitor + val clause = FilterSpecParser.parse[IgniteSqlFilterClause](viewPort.filterSpec.filter, filterTreeVisitor) + clause.toSql() + } + +// val sqlFilterClause = "" val rowCount = if(range.to > range.from) range.to - range.from else 1 val iterator = igniteStore.findChildOrder(sqlFilterClause = sqlFilterClause, startIndex = range.from, rowCount = rowCount)