title: Sorting on GSI Range key gives Unsupported type passed error
body: <p>From what I understand I am able to use a Global Secondary Index in order to sort results of an attribute, although I'm having some trouble implementing this.</p>
  <p>Essentially, the table uses the imdb of films as the Hash key, and the User ID as a Sort key. I'm attempting to get a collection of all the films a user has rated, sorted by how recently they created the rating. My belief was that by using a GSI I could bypass the requirement of needing to specify the imdb ID.</p>
  <p>I have a table:</p>
  <pre class="lang-yaml prettyprint-override"><code>RatingsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: RatingsTable
      BillingMode: PAY_PER_REQUEST
      AttributeDefinitions:
        - AttributeName: imdb_title_id
          AttributeType: N
        - AttributeName: UID
          AttributeType: S
        - AttributeName: createdAt
          AttributeType: N
  
      KeySchema:
        - AttributeName: imdb_title_id
          KeyType: HASH
        - AttributeName: UID
          KeyType: RANGE
  
      GlobalSecondaryIndexes:
          - IndexName: createdAt
            KeySchema:
              - AttributeName: UID
                KeyType: HASH
              - AttributeName: createdAt
                KeyType: RANGE
            Projection:
              ProjectionType: ALL
  </code></pre>
  <p>I wish to be able to sort on an additional field &quot;createdAt&quot;, I have logged the parameters  for the Dynamo query and it is a follows:</p>
  <pre class="lang-json prettyprint-override"><code>{
    TableName: 'RatingsTable',
    ProjectionExpression: 'imdb_title_id, createdAt, rating, ratingPercentile',
    KeyConditionExpression: 'UID = :UID',
    ExpressionAttributeValues: { ':UID': { S: 'h4XJj3YRxZiF7TDcGkxAhc' } },
    IndexName: 'createdAt',
    ScanIndexForward: false
  }
  </code></pre>
  <p>Yet I get this error:</p>
  <pre><code>Error: Unsupported type passed: createdAt
      at convertToNative (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:35:31)
      at eval (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:79:143)
      at Array.reduce (&lt;anonymous&gt;)
      at convertMap (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:76:32)
      at convertToNative (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:27:32)
      at unmarshall (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/unmarshall.js:8:77)
      at getRecentRatings (webpack-internal:///./aws/handlers/getFilms.ts:60:151)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)
      at async getFilms (webpack-internal:///./aws/handlers/getFilms.ts:35:13)
      at async runRequest (webpack-internal:///./node_modules/@middy/core/index.js:86:26)
  2022-03-18T19:38:20.150Z 1e34517b-5fc5-4a98-9bab-dc6094734aac ERROR Error: Unsupported type passed: createdAt at convertToNative (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:35:31) at eval (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:79:143) at Array.reduce (&lt;anonymous&gt;) at convertMap (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:76:32) at convertToNative (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/convertToNative.js:27:32) at unmarshall (webpack-internal:///./node_modules/@aws-sdk/util-dynamodb/dist-es/unmarshall.js:8:77) at getRecentRatings (webpack-internal:///./aws/handlers/getFilms.ts:60:151) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async getFilms (webpack-internal:///./aws/handlers/getFilms.ts:35:13) at async runRequest (webpack-internal:///./node_modules/@middy/core/index.js:86:26)
  </code></pre>
  <p>I'm not sure I understand what's causing this, I have used other indexes similarly without any issues. I'm still getting to grips with Dynamo so any help would be greatly appreciated</p>
  <hr />
  <p><strong>Update</strong>:</p>
  <p>Here's a sample of the data
  <img src="https://i.imgur.com/ZqhtFQG.png" alt="View of the data" /></p>