code: def test_select_and_groupby_with_last(self):
      # groupby and orderby together not tested because groupby
      # only applies to video data which is already sorted
      segment_size = 3
      select_query = "SELECT LAST(id), SEGMENT(data) FROM MyVideo GROUP BY '{}frames';".format(
          segment_size
      )
      actual_batch = execute_query_fetch_all(self.evadb, select_query)
      actual_batch.sort()
      ids = np.arange(NUM_FRAMES)
      segments = [
          ids[i : i + segment_size]
          for i in range(0, len(ids), segment_size)
      ]
      segments = [i for i in segments if len(i) == segment_size]
      expected_batch = list(
          create_dummy_4d_batches(
              filters=segments, start_id=segment_size - 1
          )
      )[0]
      self.assertEqual(len(actual_batch), len(expected_batch))
  
      expected_batch.rename(
          columns={
              "myvideo.id": "LAST.id",
              "myvideo.data": "SEGMENT.data",
          }
      )
      self.assertEqual(
          actual_batch,
          expected_batch.project(["LAST.id", "SEGMENT.data"]),
      )
  
imports: import unittest
  from test.util import create_dummy_4d_batches, create_dummy_batches, create_sample_video, create_table, file_remove, get_evadb_for_testing, get_logical_query_plan, load_functions_for_testing, shutdown_ray
  import numpy
  import pandas
  import pytest
  from evadb.binder.binder_utils import BinderError
  from evadb.models.storage.batch import Batch
  from evadb.optimizer.operators import LogicalFilter
  from evadb.server.command_handler import execute_query_fetch_all
label_desc: Use image node_id 15 for calling the SelectExecutorTest obj's underlying member method code with example usage: obj.test_select_and_groupby_with_last() without return types