#NEWLINE# def insert( self , obj = None , overwrite = False , partition = None , values = None , validate = True ) : #NEWLINE# #INDENT# "\n        Insert into Impala table. Wraps ImpalaClient.insert\n\n        Parameters\n        ----------\n        obj : TableExpr or pandas DataFrame\n        overwrite : boolean, default False\n          If True, will replace existing contents of table\n        partition : list or dict, optional\n          For partitioned tables, indicate the partition that's being inserted\n          into, either with an ordered list of partition keys or a dict of\n          partition field name to value. For example for the partition\n          (year=2007, month=7), this can be either (2007, 7) or {'year': 2007,\n          'month': 7}.\n        validate : boolean, default True\n          If True, do more rigorous validation that schema of table being\n          inserted is compatible with the existing table\n\n        Examples\n        --------\n        t.insert(table_expr)\n\n        # Completely overwrite contents\n        t.insert(table_expr, overwrite=True)\n        " #NEWLINE# if isinstance ( obj , pd . DataFrame ) : #NEWLINE# #INDENT# from ibis.impala.pandas_interop import write_temp_dataframe #NEWLINE# ( writer , expr ) = write_temp_dataframe ( self . _client , obj ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# expr = obj #NEWLINE# #UNINDENT# if ( values is not None ) : #NEWLINE# #INDENT# raise NotImplementedError #NEWLINE# #UNINDENT# if validate : #NEWLINE# #INDENT# existing_schema = self . schema ( ) #NEWLINE# insert_schema = expr . schema ( ) #NEWLINE# if ( not insert_schema . equals ( existing_schema ) ) : #NEWLINE# #INDENT# _validate_compatible ( insert_schema , existing_schema ) #NEWLINE# #UNINDENT# #UNINDENT# if ( partition is not None ) : #NEWLINE# #INDENT# partition_schema = self . partition_schema ( ) #NEWLINE# expr = expr . drop ( partition_schema . names ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# partition_schema = None #NEWLINE# #UNINDENT# ast = build_ast ( expr ) #NEWLINE# select = ast . queries [ 0 ] #NEWLINE# statement = ddl . InsertSelect ( self . _qualified_name , select , partition = partition , partition_schema = partition_schema , overwrite = overwrite ) #NEWLINE# return self . _execute ( statement )