scanCsv method

LazyFrame scanCsv(
  1. String path, {
  2. bool hasHeader = true,
  3. String separator = ',',
  4. int? skipRows,
  5. int? nRows,
  6. bool tryParseDates = false,
})

Lazily scans the CSV file at path.

Query execution is deferred until the returned LazyFrame is collected; schema discovery may inspect the source. separator must be a single byte. skipRows and nRows must be non-negative when given. Set tryParseDates to infer date columns.

Implementation

LazyFrame scanCsv(
  String path, {
  bool hasHeader = true,
  String separator = ',',
  int? skipRows,
  int? nRows,
  bool tryParseDates = false,
}) {
  _validatePath(path);
  _validateSeparator(separator);
  _validateUnsigned(skipRows, 'skipRows');
  _validateUnsigned(nRows, 'nRows');
  return _adoptLazy(
    _client.invokeSync('lazyScanCsv', {
      'path': path,
      'hasHeader': hasHeader,
      'separator': separator,
      if (skipRows != null) 'skipRows': skipRows,
      if (nRows != null) 'nRows': nRows,
      'tryParseDates': tryParseDates,
    }),
  );
}