Skip to content

Commit

Permalink
fix bug (#3240)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott authored Dec 15, 2023
1 parent efb11ea commit 2ad55d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/parquetquery/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *StringInPredicate) KeepColumnChunk(cc *ColumnChunkHelper) bool {
}

ci, err := cc.ColumnIndex()
if err != nil && ci != nil {
if err == nil && ci != nil {
for _, subs := range p.ss {
for i := 0; i < ci.NumPages(); i++ {
ok := bytes.Compare(ci.MinValue(i).ByteArray(), subs) <= 0 && bytes.Compare(ci.MaxValue(i).ByteArray(), subs) >= 0
Expand Down Expand Up @@ -248,7 +248,7 @@ func (p *IntBetweenPredicate) String() string {

func (p *IntBetweenPredicate) KeepColumnChunk(c *ColumnChunkHelper) bool {
ci, err := c.ColumnIndex()
if err != nil && ci != nil {
if err == nil && ci != nil {
for i := 0; i < ci.NumPages(); i++ {
min := ci.MinValue(i).Int64()
max := ci.MaxValue(i).Int64()
Expand Down Expand Up @@ -305,7 +305,7 @@ func (p *GenericPredicate[T]) KeepColumnChunk(c *ColumnChunkHelper) bool {
}

ci, err := c.ColumnIndex()
if err != nil && ci != nil {
if err == nil && ci != nil {
for i := 0; i < ci.NumPages(); i++ {
min := p.Extract(ci.MinValue(i))
max := p.Extract(ci.MaxValue(i))
Expand Down Expand Up @@ -371,7 +371,7 @@ func (p *FloatBetweenPredicate) String() string {

func (p *FloatBetweenPredicate) KeepColumnChunk(c *ColumnChunkHelper) bool {
ci, err := c.ColumnIndex()
if err != nil && ci != nil {
if err == nil && ci != nil {
for i := 0; i < ci.NumPages(); i++ {
min := ci.MinValue(i).Double()
max := ci.MaxValue(i).Double()
Expand Down

0 comments on commit 2ad55d1

Please sign in to comment.