diff --git a/command.go b/command.go index 3666a994..aee7e30f 100644 --- a/command.go +++ b/command.go @@ -414,9 +414,13 @@ func (cmd *baseCommand) setRead(policy *BasePolicy, key *Key, binNames []string) predSize := 0 if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { return err } + if predSize > 0 { + fieldCount++ + } } else if len(policy.PredExp) > 0 { predSize = cmd.estimatePredExpSize(policy.PredExp) fieldCount++ diff --git a/expression_test.go b/expression_test.go index af896f80..5f90bac3 100644 --- a/expression_test.go +++ b/expression_test.go @@ -708,7 +708,7 @@ var _ = gg.Describe("Expression Filters", func() { as.ExpIntBin("bin"), as.ExpIntVal(35), ) - _, err = client.Get(rpolicy, key) + _, err = client.Get(rpolicy, key, "bin") gm.Expect(err).ToNot(gm.HaveOccurred()) })