kettle icon indicating copy to clipboard operation
kettle copied to clipboard

Cannot call NULL or NOT_NULL

Open rsands2801 opened this issue 8 years ago • 3 comments

These two conditions for filtering should not have any extra attributes sent with them. The build conditions can be changed to check for condition2 being present - this allows us to call as follows:

->filter('column', 'NULL', false)

public function _buildConditions($conditions)
    {
        $result = array();

        foreach ($conditions as $i => $condition) {
            $key = $condition[0];
            $operator = $condition[1];

            $attributes = array();

           if ($condition[2] !== false) {

                $value = $condition[2];

                if (!is_array($value)) {
                    $value = array((string) $value);
                }

                foreach ($value as $v) {
                    $attributes[] = array($this->_getDataType($key) => (string) $v);
                }
            }

            $result[$key] = array(
                'ComparisonOperator' => $operator,
                'AttributeValueList' => $attributes,
            );
        }
        return $result;
    }

rsands2801 avatar Apr 29 '16 03:04 rsands2801

Hi rsands2801

I confirmed the bug.

Thank you for your sample code. I consider how to fix.

Thanks.

inouet avatar May 15 '16 05:05 inouet

No problem @inouet

One other problem you may be interested in: you cannot build up multiple filters with the same column name. It only allows users to filter the same field name once

rsands2801 avatar May 15 '16 06:05 rsands2801

Is it possible to use multiple filters on same attribute?

https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-dynamodb-2012-08-10.html#scan

On this document, argument ScanFilter is an associative array with the keys of "AttributeName". so, I think that we can't be specify multiple AttributeName.

Thanks

inouet avatar May 15 '16 07:05 inouet