@@ -3120,11 +3120,7 @@ private TableResult queryFallbackArrow(
31203120 return TableResult .newBuilder ()
31213121 .setSchema (schema )
31223122 .setTotalRows (numDmlAffectedRows != null ? numDmlAffectedRows : 0L )
3123- .setPageNoSchema (
3124- new PageImpl <>(
3125- new TableDataPageFetcher (null , schema , getOptions (), null , optionMap (options )),
3126- null ,
3127- ImmutableList .of ()))
3123+ .setPageNoSchema (new PageImpl <>(null , null , ImmutableList .of ()))
31283124 .setJobId (completedJob .getJobId ())
31293125 .setRowsInPage (0L )
31303126 .setStatementType (statementType )
@@ -3153,29 +3149,18 @@ private TableResult queryFallbackArrow(
31533149 firstPage != null ? ImmutableList .copyOf (firstPage .getValues ()) : ImmutableList .of ();
31543150 long rowsInPage = (long ) firstPageRows .size ();
31553151
3156- Table destTable = null ;
3157- try {
3158- destTable = getTable (destinationTable );
3159- } catch (Exception e ) {
3160- // Non-fatal table lookup failure
3161- }
31623152 long totalRows =
31633153 numDmlAffectedRows != null
31643154 ? numDmlAffectedRows
3165- : (destTable != null && destTable . getNumRows () != null
3166- ? destTable . getNumRows (). longValue ()
3155+ : (readSession . getEstimatedRowCount () > 0
3156+ ? readSession . getEstimatedRowCount ()
31673157 : rowsInPage );
31683158
31693159 return TableResult .newBuilder ()
31703160 .setSchema (schema )
31713161 .setTotalRows (totalRows )
31723162 .setPageNoSchema (
3173- firstPage != null
3174- ? firstPage
3175- : new PageImpl <>(
3176- new TableDataPageFetcher (null , schema , getOptions (), null , optionMap (options )),
3177- null ,
3178- ImmutableList .of ()))
3163+ firstPage != null ? firstPage : new PageImpl <>(null , null , ImmutableList .of ()))
31793164 .setJobId (completedJob .getJobId ())
31803165 .setRowsInPage (rowsInPage )
31813166 .setStatementType (statementType )
0 commit comments