<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_table( self, impala_name, kudu_name, primary_keys=None, obj=None, schema=None, database=None, external=False, force=False, ):
 """ Create an Kudu-backed table in the connected Impala cluster. For non-external tables, this will create a Kudu table with a compatible storage schema. This function is patterned after the ImpalaClient.create_table function designed for physical filesystems (like HDFS). Parameters impala_name : string Name of the created Impala table kudu_name : string Name of hte backing Kudu table. Will be created if external=False primary_keys : list of column names List of obj : TableExpr or pandas.DataFrame, optional If passed, creates table from select statement results schema : ibis.Schema, optional Mutually exclusive with expr, creates an empty table with a particular schema database : string, default None (optional) external : boolean, default False If False, a new Kudu table will be created. Otherwise, the Kudu table must already exist. """

        self._check_connected()

        if not external and (primary_keys is None or len(primary_keys) == 0):
            raise ValueError(
                'Must specify primary keys when DDL creates a '
                'new Kudu table'
            )

        if obj is not None:
            if external:
                raise ValueError(
                    'Cannot create an external Kudu-Impala table '
                    'from an expression or DataFrame'
                )

            if isinstance(obj, pd.DataFrame):
                from ibis.impala.pandas_interop import write_temp_dataframe

                writer, to_insert = write_temp_dataframe(
                    self.impala_client, obj
                )
            else:
                to_insert = obj
            # XXX: exposing a lot of internals
            ast = self.impala_client._build_ast(to_insert)
            select = ast.queries[0]

            stmt = CTASKudu(
                impala_name,
                kudu_name,
                self.client.master_addrs,
                select,
                primary_keys,
                database=database,
            )
        else:
            if external:
                ktable = self.client.table(kudu_name)
                kschema = ktable.schema
                schema = schema_kudu_to_ibis(kschema)
                primary_keys = kschema.primary_keys()
            elif schema is None:
                raise ValueError(
                    'Must specify schema for new empty ' 'Kudu-backed table'
                )

            stmt = CreateTableKudu(
                impala_name,
                kudu_name,
                self.client.master_addrs,
                schema,
                primary_keys,
                external=external,
                database=database,
                can_exist=False,
            )

        self.impala_client._execute(stmt)