Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

103
Vistas
Convert Column of timestamps in Arrow Table to JS Dates

I have an Arrow Table with a column full of timestamps. Ultimately, I'm calling .toArray() on the Table to pass it through to some legacy code. This legacy code is expecting JS Date objects instead of timestamps. What's the most efficient way to do this conversion?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I solved this problem like this:

import { Column, DataType, DateVector, Table } from "apache-arrow"

const columns = new Array(table.numCols)
for (let i = 0; i < table.numCols; i++) {
  const column = table.getColumnAt(i)
  if (DataType.isTimestamp(column.type)) {
    columns[i] = Column.new(column.name, DateVector.from(Array.from(column, (d) => new Date(d))))
  } else {
    columns[i] = column
  }
}

const newTable = Table.new.apply(null, columns)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda