Difference between revisions of "Gaia EDR3"

From Public PIC Wiki
Jump to navigation Jump to search
(Created page with "== Raw data == Mirrored to cephfs using lftp: mirror -r -v -c -P4 http://cdn.gea.esac.esa.int/Gaia/gedr3/gaia_source/ /cephfs/pic.es/astro/scratch/tallada/gaia_edr3 ==...")
 
 
Line 112: Line 112:
 
  LOCATION '/user/tallada/data/gaia_edr3'
 
  LOCATION '/user/tallada/data/gaia_edr3'
 
  ;
 
  ;
 +
 +
 +
== Internal table ==
 +
 +
CREATE TABLE cosmohub.gaia_edr3 (
 +
    solution_id bigint,
 +
    designation string,
 +
    source_id bigint,
 +
    random_index bigint,
 +
    ref_epoch float,
 +
    ra double,
 +
    ra_error float,
 +
    `dec` double,
 +
    dec_error float,
 +
    parallax double,
 +
    parallax_error float,
 +
    parallax_over_error float,
 +
    pm float,
 +
    pmra double,
 +
    pmra_error float,
 +
    pmdec double,
 +
    pmdec_error float,
 +
    ra_dec_corr float,
 +
    ra_parallax_corr float,
 +
    ra_pmra_corr float,
 +
    ra_pmdec_corr float,
 +
    dec_parallax_corr float,
 +
    dec_pmra_corr float,
 +
    dec_pmdec_corr float,
 +
    parallax_pmra_corr float,
 +
    parallax_pmdec_corr float,
 +
    pmra_pmdec_corr float,
 +
    astrometric_n_obs_al smallint,
 +
    astrometric_n_obs_ac smallint,
 +
    astrometric_n_good_obs_al smallint,
 +
    astrometric_n_bad_obs_al smallint,
 +
    astrometric_gof_al float,
 +
    astrometric_chi2_al float,
 +
    astrometric_excess_noise float,
 +
    astrometric_excess_noise_sig float,
 +
    astrometric_params_solved tinyint,
 +
    astrometric_primary_flag boolean,
 +
    nu_eff_used_in_astrometry float,
 +
    pseudocolour float,
 +
    pseudocolour_error float,
 +
    ra_pseudocolour_corr float,
 +
    dec_pseudocolour_corr float,
 +
    parallax_pseudocolour_corr float,
 +
    pmra_pseudocolour_corr float,
 +
    pmdec_pseudocolour_corr float,
 +
    astrometric_matched_transits smallint,
 +
    visibility_periods_used smallint,
 +
    astrometric_sigma5d_max float,
 +
    matched_transits smallint,
 +
    new_matched_transits smallint,
 +
    matched_transits_removed smallint,
 +
    ipd_gof_harmonic_amplitude float,
 +
    ipd_gof_harmonic_phase float,
 +
    ipd_frac_multi_peak tinyint,
 +
    ipd_frac_odd_win tinyint,
 +
    ruwe float,
 +
    scan_direction_strength_k1 float,
 +
    scan_direction_strength_k2 float,
 +
    scan_direction_strength_k3 float,
 +
    scan_direction_strength_k4 float,
 +
    scan_direction_mean_k1 float,
 +
    scan_direction_mean_k2 float,
 +
    scan_direction_mean_k3 float,
 +
    scan_direction_mean_k4 float,
 +
    duplicated_source boolean,
 +
    phot_g_n_obs smallint,
 +
    phot_g_mean_flux double,
 +
    phot_g_mean_flux_error float,
 +
    phot_g_mean_flux_over_error float,
 +
    phot_g_mean_mag float,
 +
    phot_bp_n_obs smallint,
 +
    phot_bp_mean_flux double,
 +
    phot_bp_mean_flux_error float,
 +
    phot_bp_mean_flux_over_error float,
 +
    phot_bp_mean_mag float,
 +
    phot_rp_n_obs smallint,
 +
    phot_rp_mean_flux double,
 +
    phot_rp_mean_flux_error float,
 +
    phot_rp_mean_flux_over_error float,
 +
    phot_rp_mean_mag float,
 +
    phot_bp_n_contaminated_transits smallint,
 +
    phot_bp_n_blended_transits smallint,
 +
    phot_rp_n_contaminated_transits smallint,
 +
    phot_rp_n_blended_transits smallint,
 +
    phot_proc_mode tinyint,
 +
    phot_bp_rp_excess_factor float,
 +
    bp_rp float,
 +
    bp_g float,
 +
    g_rp float,
 +
    dr2_radial_velocity float,
 +
    dr2_radial_velocity_error float,
 +
    dr2_rv_nb_transits smallint,
 +
    dr2_rv_template_teff float,
 +
    dr2_rv_template_logg float,
 +
    dr2_rv_template_fe_h float,
 +
    l double,
 +
    b double,
 +
    ecl_lon double,
 +
    ecl_lat double
 +
)
 +
CLUSTERED BY (source_id)
 +
SORTED BY (source_id ASC)
 +
INTO 2048 BUCKETS
 +
STORED AS ORC
 +
;
 +
 +
INSERT INTO cosmohub.gaia_edr3
 +
SELECT * FROM tallada.gaia_edr3_csv
 +
WHERE source_id IS NOT NULL
 +
;
 +
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE solution_id solution_id bigint COMMENT "Solution Identifier";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE designation designation string COMMENT "Unique source designation, unique across all Data Releases";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE source_id source_id bigint COMMENT "Unique source identifier, unique within a particular Data Release";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE random_index random_index bigint COMMENT "Random index used to select subsets";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ref_epoch ref_epoch float COMMENT "Reference epoch";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra ra double COMMENT "Right ascension";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_error ra_error float COMMENT "Standard error of right ascension";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE `dec` `dec` double COMMENT "Declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_error dec_error float COMMENT "Standard error of declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax parallax double COMMENT "Parallax";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_error parallax_error float COMMENT "Standard error of parallax";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_over_error parallax_over_error float COMMENT "Parallax divided by its standard error";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pm pm float COMMENT "Total proper motion";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra pmra double COMMENT "Proper motion in right ascension direction";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra_error pmra_error float COMMENT "Standard error of proper motion in right ascension direction";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmdec pmdec double COMMENT "Proper motion in declination direction";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmdec_error pmdec_error float COMMENT "Standard error of proper motion in declination direction";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_dec_corr ra_dec_corr float COMMENT "Correlation between right ascension and declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_parallax_corr ra_parallax_corr float COMMENT "Correlation between right ascension and parallax";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_pmra_corr ra_pmra_corr float COMMENT "Correlation between right ascension and proper motion in right ascension";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_pmdec_corr ra_pmdec_corr float COMMENT "Correlation between right ascension and proper motion in declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_parallax_corr dec_parallax_corr float COMMENT "Correlation between declination and parallax";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_pmra_corr dec_pmra_corr float COMMENT "Correlation between declination and proper motion in right ascension";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_pmdec_corr dec_pmdec_corr float COMMENT "Correlation between declination and proper motion in declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_pmra_corr parallax_pmra_corr float COMMENT "Correlation between parallax and proper motion in right ascension";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_pmdec_corr parallax_pmdec_corr float COMMENT "Correlation between parallax and proper motion in declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra_pmdec_corr pmra_pmdec_corr float COMMENT "Correlation between proper motion in right ascension and proper motion in declination";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_obs_al astrometric_n_obs_al smallint COMMENT "Total number of observations AL";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_obs_ac astrometric_n_obs_ac smallint COMMENT "Total number of observations AC";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_good_obs_al astrometric_n_good_obs_al smallint COMMENT "Number of good observations AL";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_bad_obs_al astrometric_n_bad_obs_al smallint COMMENT "Number of bad observations AL";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_gof_al astrometric_gof_al float COMMENT "Goodness of fit statistic of model wrt along-scan observations";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_chi2_al astrometric_chi2_al float COMMENT "AL chi-square value";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_excess_noise astrometric_excess_noise float COMMENT "Excess noise of the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_excess_noise_sig astrometric_excess_noise_sig float COMMENT "Significance of excess noise";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_params_solved astrometric_params_solved tinyint COMMENT "Which parameters have been solved for?";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_primary_flag astrometric_primary_flag boolean COMMENT "Primary or seconday";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE nu_eff_used_in_astrometry nu_eff_used_in_astrometry float COMMENT "Effective wavenumber of the source used in the astrometric solution";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pseudocolour pseudocolour float COMMENT "Astrometrically estimated pseudocolour of the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pseudocolour_error pseudocolour_error float COMMENT "Standard error of the pseudocolour of the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_pseudocolour_corr ra_pseudocolour_corr float COMMENT "Correlation between right ascension and pseudocolour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_pseudocolour_corr dec_pseudocolour_corr float COMMENT "Correlation between declination and pseudocolour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_pseudocolour_corr parallax_pseudocolour_corr float COMMENT "Correlation between parallax and pseudocolour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra_pseudocolour_corr pmra_pseudocolour_corr float COMMENT "Correlation between proper motion in right asension and pseudocolour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmdec_pseudocolour_corr pmdec_pseudocolour_corr float COMMENT "Correlation between proper motion in declination and pseudocolour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_matched_transits astrometric_matched_transits smallint COMMENT "Matched FOV transits used in the AGIS solution";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE visibility_periods_used visibility_periods_used smallint COMMENT "Number of visibility periods used in Astrometric solution";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_sigma5d_max astrometric_sigma5d_max float COMMENT "The longest semi-major axis of the 5-d error ellipsoid";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE matched_transits matched_transits smallint COMMENT "The number of transits matched to this source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE new_matched_transits new_matched_transits smallint COMMENT "The number of transits newly incorporated into an existing source in the current cycle";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE matched_transits_removed matched_transits_removed smallint COMMENT "The number of transits removed from an existing source in the current cycle";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_gof_harmonic_amplitude ipd_gof_harmonic_amplitude float COMMENT "Amplitude of the IPD GoF versus position angle of scan";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_gof_harmonic_phase ipd_gof_harmonic_phase float COMMENT "Phase of the IPD GoF versus position angle of scan";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_frac_multi_peak ipd_frac_multi_peak tinyint COMMENT "Percent of successful-IPD windows with more than one peak";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_frac_odd_win ipd_frac_odd_win tinyint COMMENT "Percent of transits with truncated windows or multiple gate";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ruwe ruwe float COMMENT "Renormalised unit weight error";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k1 scan_direction_strength_k1 float COMMENT "Degree of concentration of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k2 scan_direction_strength_k2 float COMMENT "Degree of concentration of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k3 scan_direction_strength_k3 float COMMENT "Degree of concentration of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k4 scan_direction_strength_k4 float COMMENT "Degree of concentration of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k1 scan_direction_mean_k1 float COMMENT "Mean position angle of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k2 scan_direction_mean_k2 float COMMENT "Mean position angle of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k3 scan_direction_mean_k3 float COMMENT "Mean position angle of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k4 scan_direction_mean_k4 float COMMENT "Mean position angle of scan directions across the source";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE duplicated_source duplicated_source boolean COMMENT "Source with multiple source identifiers";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_n_obs phot_g_n_obs smallint COMMENT "Number of observations contributing to G photometry";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_flux phot_g_mean_flux double COMMENT "G-band mean flux";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_flux_error phot_g_mean_flux_error float COMMENT "Error on G-band mean flux";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_flux_over_error phot_g_mean_flux_over_error float COMMENT "G-band mean flux divided by its error";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_mag phot_g_mean_mag float COMMENT "G-band mean magnitude";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_n_obs phot_bp_n_obs smallint COMMENT "Number of observations contributing to BP photometry";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_flux phot_bp_mean_flux double COMMENT "Integrated BP mean flux";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_flux_error phot_bp_mean_flux_error float COMMENT "Error on the integrated BP mean flux";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_flux_over_error phot_bp_mean_flux_over_error float COMMENT "Integrated BP mean flux divided by its error";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_mag phot_bp_mean_mag float COMMENT "Integrated BP mean magnitude";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_n_obs phot_rp_n_obs smallint COMMENT "Number of observations contributing to RP photometry";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_flux phot_rp_mean_flux double COMMENT "Integrated RP mean flux";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_flux_error phot_rp_mean_flux_error float COMMENT "Error on the integrated RP mean flux";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_flux_over_error phot_rp_mean_flux_over_error float COMMENT "Integrated RP mean flux divided by its error";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_mag phot_rp_mean_mag float COMMENT "Integrated RP mean magnitude";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_n_contaminated_transits phot_bp_n_contaminated_transits smallint COMMENT "Number of BP contaminated transits";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_n_blended_transits phot_bp_n_blended_transits smallint COMMENT "Number of BP blended transits";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_n_contaminated_transits phot_rp_n_contaminated_transits smallint COMMENT "Number of RP contaminated transits";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_n_blended_transits phot_rp_n_blended_transits smallint COMMENT "Number of RP blended transits";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_proc_mode phot_proc_mode tinyint COMMENT "Photometry processing mode";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_rp_excess_factor phot_bp_rp_excess_factor float COMMENT "BP/RP excess factor";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE bp_rp bp_rp float COMMENT "BP - RP colour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE bp_g bp_g float COMMENT "BP - G colour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE g_rp g_rp float COMMENT "G - RP colour";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_radial_velocity dr2_radial_velocity float COMMENT "Radial velocity from Gaia DR2";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_radial_velocity_error dr2_radial_velocity_error float COMMENT "Radial velocity error from Gaia DR2";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_nb_transits dr2_rv_nb_transits smallint COMMENT "Number of transits used to compute radial velocity in Gaia DR2";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_template_teff dr2_rv_template_teff float COMMENT "Teff of the template used to compute radial velocity in Gaia DR2";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_template_logg dr2_rv_template_logg float COMMENT "logg of the template used to compute radial velocity in Gaia DR2";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_template_fe_h dr2_rv_template_fe_h float COMMENT "Fe/H of the template used to compute radial velocity in Gaia DR2";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE l l double COMMENT "Galactic longitude";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE b b double COMMENT "Galactic latitude";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ecl_lon ecl_lon double COMMENT "Ecliptic longitude";
 +
ALTER TABLE cosmohub.gaia_edr3 CHANGE ecl_lat ecl_lat double COMMENT "Ecliptic latitude";
 +
 +
ANALYZE TABLE cosmohub.gaia_edr3 COMPUTE STATISTICS FOR COLUMNS;

Latest revision as of 17:40, 3 December 2020

Raw data

Mirrored to cephfs using lftp:

   mirror -r -v -c -P4 http://cdn.gea.esac.esa.int/Gaia/gedr3/gaia_source/ /cephfs/pic.es/astro/scratch/tallada/gaia_edr3

External table

CREATE EXTERNAL TABLE tallada.gaia_edr3_csv (
    solution_id bigint,
    designation string,
    source_id bigint,
    random_index bigint,
    ref_epoch float,
    ra double,
    ra_error float,
    `dec` double,
    dec_error float,
    parallax double,
    parallax_error float,
    parallax_over_error float,
    pm float,
    pmra double,
    pmra_error float,
    pmdec double,
    pmdec_error float,
    ra_dec_corr float,
    ra_parallax_corr float,
    ra_pmra_corr float,
    ra_pmdec_corr float,
    dec_parallax_corr float,
    dec_pmra_corr float,
    dec_pmdec_corr float,
    parallax_pmra_corr float,
    parallax_pmdec_corr float,
    pmra_pmdec_corr float,
    astrometric_n_obs_al smallint,
    astrometric_n_obs_ac smallint,
    astrometric_n_good_obs_al smallint,
    astrometric_n_bad_obs_al smallint,
    astrometric_gof_al float,
    astrometric_chi2_al float,
    astrometric_excess_noise float,
    astrometric_excess_noise_sig float,
    astrometric_params_solved tinyint,
    astrometric_primary_flag boolean,
    nu_eff_used_in_astrometry float,
    pseudocolour float,
    pseudocolour_error float,
    ra_pseudocolour_corr float,
    dec_pseudocolour_corr float,
    parallax_pseudocolour_corr float,
    pmra_pseudocolour_corr float,
    pmdec_pseudocolour_corr float,
    astrometric_matched_transits smallint,
    visibility_periods_used smallint,
    astrometric_sigma5d_max float,
    matched_transits smallint,
    new_matched_transits smallint,
    matched_transits_removed smallint,
    ipd_gof_harmonic_amplitude float,
    ipd_gof_harmonic_phase float,
    ipd_frac_multi_peak tinyint,
    ipd_frac_odd_win tinyint,
    ruwe float,
    scan_direction_strength_k1 float,
    scan_direction_strength_k2 float,
    scan_direction_strength_k3 float,
    scan_direction_strength_k4 float,
    scan_direction_mean_k1 float,
    scan_direction_mean_k2 float,
    scan_direction_mean_k3 float,
    scan_direction_mean_k4 float,
    duplicated_source boolean,
    phot_g_n_obs smallint,
    phot_g_mean_flux double,
    phot_g_mean_flux_error float,
    phot_g_mean_flux_over_error float,
    phot_g_mean_mag float,
    phot_bp_n_obs smallint,
    phot_bp_mean_flux double,
    phot_bp_mean_flux_error float,
    phot_bp_mean_flux_over_error float,
    phot_bp_mean_mag float,
    phot_rp_n_obs smallint,
    phot_rp_mean_flux double,
    phot_rp_mean_flux_error float,
    phot_rp_mean_flux_over_error float,
    phot_rp_mean_mag float,
    phot_bp_n_contaminated_transits smallint,
    phot_bp_n_blended_transits smallint,
    phot_rp_n_contaminated_transits smallint,
    phot_rp_n_blended_transits smallint,
    phot_proc_mode tinyint,
    phot_bp_rp_excess_factor float,
    bp_rp float,
    bp_g float,
    g_rp float,
    dr2_radial_velocity float,
    dr2_radial_velocity_error float,
    dr2_rv_nb_transits smallint,
    dr2_rv_template_teff float,
    dr2_rv_template_logg float,
    dr2_rv_template_fe_h float,
    l double,
    b double,
    ecl_lon double,
    ecl_lat double
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/tallada/data/gaia_edr3'
;


Internal table

CREATE TABLE cosmohub.gaia_edr3 (
    solution_id bigint,
    designation string,
    source_id bigint,
    random_index bigint,
    ref_epoch float,
    ra double,
    ra_error float,
    `dec` double,
    dec_error float,
    parallax double,
    parallax_error float,
    parallax_over_error float,
    pm float,
    pmra double,
    pmra_error float,
    pmdec double,
    pmdec_error float,
    ra_dec_corr float,
    ra_parallax_corr float,
    ra_pmra_corr float,
    ra_pmdec_corr float,
    dec_parallax_corr float,
    dec_pmra_corr float,
    dec_pmdec_corr float,
    parallax_pmra_corr float,
    parallax_pmdec_corr float,
    pmra_pmdec_corr float,
    astrometric_n_obs_al smallint,
    astrometric_n_obs_ac smallint,
    astrometric_n_good_obs_al smallint,
    astrometric_n_bad_obs_al smallint,
    astrometric_gof_al float,
    astrometric_chi2_al float,
    astrometric_excess_noise float,
    astrometric_excess_noise_sig float,
    astrometric_params_solved tinyint,
    astrometric_primary_flag boolean,
    nu_eff_used_in_astrometry float,
    pseudocolour float,
    pseudocolour_error float,
    ra_pseudocolour_corr float,
    dec_pseudocolour_corr float,
    parallax_pseudocolour_corr float,
    pmra_pseudocolour_corr float,
    pmdec_pseudocolour_corr float,
    astrometric_matched_transits smallint,
    visibility_periods_used smallint,
    astrometric_sigma5d_max float,
    matched_transits smallint,
    new_matched_transits smallint,
    matched_transits_removed smallint,
    ipd_gof_harmonic_amplitude float,
    ipd_gof_harmonic_phase float,
    ipd_frac_multi_peak tinyint,
    ipd_frac_odd_win tinyint,
    ruwe float,
    scan_direction_strength_k1 float,
    scan_direction_strength_k2 float,
    scan_direction_strength_k3 float,
    scan_direction_strength_k4 float,
    scan_direction_mean_k1 float,
    scan_direction_mean_k2 float,
    scan_direction_mean_k3 float,
    scan_direction_mean_k4 float,
    duplicated_source boolean,
    phot_g_n_obs smallint,
    phot_g_mean_flux double,
    phot_g_mean_flux_error float,
    phot_g_mean_flux_over_error float,
    phot_g_mean_mag float,
    phot_bp_n_obs smallint,
    phot_bp_mean_flux double,
    phot_bp_mean_flux_error float,
    phot_bp_mean_flux_over_error float,
    phot_bp_mean_mag float,
    phot_rp_n_obs smallint,
    phot_rp_mean_flux double,
    phot_rp_mean_flux_error float,
    phot_rp_mean_flux_over_error float,
    phot_rp_mean_mag float,
    phot_bp_n_contaminated_transits smallint,
    phot_bp_n_blended_transits smallint,
    phot_rp_n_contaminated_transits smallint,
    phot_rp_n_blended_transits smallint,
    phot_proc_mode tinyint,
    phot_bp_rp_excess_factor float,
    bp_rp float,
    bp_g float,
    g_rp float,
    dr2_radial_velocity float,
    dr2_radial_velocity_error float,
    dr2_rv_nb_transits smallint,
    dr2_rv_template_teff float,
    dr2_rv_template_logg float,
    dr2_rv_template_fe_h float,
    l double,
    b double,
    ecl_lon double,
    ecl_lat double
)
CLUSTERED BY (source_id)
SORTED BY (source_id ASC)
INTO 2048 BUCKETS
STORED AS ORC
;
INSERT INTO cosmohub.gaia_edr3
SELECT * FROM tallada.gaia_edr3_csv
WHERE source_id IS NOT NULL
;
ALTER TABLE cosmohub.gaia_edr3 CHANGE solution_id solution_id bigint COMMENT "Solution Identifier";
ALTER TABLE cosmohub.gaia_edr3 CHANGE designation designation string COMMENT "Unique source designation, unique across all Data Releases";
ALTER TABLE cosmohub.gaia_edr3 CHANGE source_id source_id bigint COMMENT "Unique source identifier, unique within a particular Data Release";
ALTER TABLE cosmohub.gaia_edr3 CHANGE random_index random_index bigint COMMENT "Random index used to select subsets";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ref_epoch ref_epoch float COMMENT "Reference epoch";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra ra double COMMENT "Right ascension";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_error ra_error float COMMENT "Standard error of right ascension";
ALTER TABLE cosmohub.gaia_edr3 CHANGE `dec` `dec` double COMMENT "Declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_error dec_error float COMMENT "Standard error of declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax parallax double COMMENT "Parallax";
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_error parallax_error float COMMENT "Standard error of parallax";
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_over_error parallax_over_error float COMMENT "Parallax divided by its standard error";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pm pm float COMMENT "Total proper motion";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra pmra double COMMENT "Proper motion in right ascension direction";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra_error pmra_error float COMMENT "Standard error of proper motion in right ascension direction";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmdec pmdec double COMMENT "Proper motion in declination direction";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmdec_error pmdec_error float COMMENT "Standard error of proper motion in declination direction";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_dec_corr ra_dec_corr float COMMENT "Correlation between right ascension and declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_parallax_corr ra_parallax_corr float COMMENT "Correlation between right ascension and parallax";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_pmra_corr ra_pmra_corr float COMMENT "Correlation between right ascension and proper motion in right ascension";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_pmdec_corr ra_pmdec_corr float COMMENT "Correlation between right ascension and proper motion in declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_parallax_corr dec_parallax_corr float COMMENT "Correlation between declination and parallax";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_pmra_corr dec_pmra_corr float COMMENT "Correlation between declination and proper motion in right ascension";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_pmdec_corr dec_pmdec_corr float COMMENT "Correlation between declination and proper motion in declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_pmra_corr parallax_pmra_corr float COMMENT "Correlation between parallax and proper motion in right ascension";
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_pmdec_corr parallax_pmdec_corr float COMMENT "Correlation between parallax and proper motion in declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra_pmdec_corr pmra_pmdec_corr float COMMENT "Correlation between proper motion in right ascension and proper motion in declination";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_obs_al astrometric_n_obs_al smallint COMMENT "Total number of observations AL";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_obs_ac astrometric_n_obs_ac smallint COMMENT "Total number of observations AC";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_good_obs_al astrometric_n_good_obs_al smallint COMMENT "Number of good observations AL";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_n_bad_obs_al astrometric_n_bad_obs_al smallint COMMENT "Number of bad observations AL";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_gof_al astrometric_gof_al float COMMENT "Goodness of fit statistic of model wrt along-scan observations";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_chi2_al astrometric_chi2_al float COMMENT "AL chi-square value";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_excess_noise astrometric_excess_noise float COMMENT "Excess noise of the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_excess_noise_sig astrometric_excess_noise_sig float COMMENT "Significance of excess noise";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_params_solved astrometric_params_solved tinyint COMMENT "Which parameters have been solved for?";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_primary_flag astrometric_primary_flag boolean COMMENT "Primary or seconday";
ALTER TABLE cosmohub.gaia_edr3 CHANGE nu_eff_used_in_astrometry nu_eff_used_in_astrometry float COMMENT "Effective wavenumber of the source used in the astrometric solution";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pseudocolour pseudocolour float COMMENT "Astrometrically estimated pseudocolour of the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pseudocolour_error pseudocolour_error float COMMENT "Standard error of the pseudocolour of the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ra_pseudocolour_corr ra_pseudocolour_corr float COMMENT "Correlation between right ascension and pseudocolour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dec_pseudocolour_corr dec_pseudocolour_corr float COMMENT "Correlation between declination and pseudocolour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE parallax_pseudocolour_corr parallax_pseudocolour_corr float COMMENT "Correlation between parallax and pseudocolour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmra_pseudocolour_corr pmra_pseudocolour_corr float COMMENT "Correlation between proper motion in right asension and pseudocolour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE pmdec_pseudocolour_corr pmdec_pseudocolour_corr float COMMENT "Correlation between proper motion in declination and pseudocolour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_matched_transits astrometric_matched_transits smallint COMMENT "Matched FOV transits used in the AGIS solution";
ALTER TABLE cosmohub.gaia_edr3 CHANGE visibility_periods_used visibility_periods_used smallint COMMENT "Number of visibility periods used in Astrometric solution";
ALTER TABLE cosmohub.gaia_edr3 CHANGE astrometric_sigma5d_max astrometric_sigma5d_max float COMMENT "The longest semi-major axis of the 5-d error ellipsoid";
ALTER TABLE cosmohub.gaia_edr3 CHANGE matched_transits matched_transits smallint COMMENT "The number of transits matched to this source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE new_matched_transits new_matched_transits smallint COMMENT "The number of transits newly incorporated into an existing source in the current cycle";
ALTER TABLE cosmohub.gaia_edr3 CHANGE matched_transits_removed matched_transits_removed smallint COMMENT "The number of transits removed from an existing source in the current cycle";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_gof_harmonic_amplitude ipd_gof_harmonic_amplitude float COMMENT "Amplitude of the IPD GoF versus position angle of scan";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_gof_harmonic_phase ipd_gof_harmonic_phase float COMMENT "Phase of the IPD GoF versus position angle of scan";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_frac_multi_peak ipd_frac_multi_peak tinyint COMMENT "Percent of successful-IPD windows with more than one peak";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ipd_frac_odd_win ipd_frac_odd_win tinyint COMMENT "Percent of transits with truncated windows or multiple gate";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ruwe ruwe float COMMENT "Renormalised unit weight error";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k1 scan_direction_strength_k1 float COMMENT "Degree of concentration of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k2 scan_direction_strength_k2 float COMMENT "Degree of concentration of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k3 scan_direction_strength_k3 float COMMENT "Degree of concentration of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_strength_k4 scan_direction_strength_k4 float COMMENT "Degree of concentration of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k1 scan_direction_mean_k1 float COMMENT "Mean position angle of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k2 scan_direction_mean_k2 float COMMENT "Mean position angle of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k3 scan_direction_mean_k3 float COMMENT "Mean position angle of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE scan_direction_mean_k4 scan_direction_mean_k4 float COMMENT "Mean position angle of scan directions across the source";
ALTER TABLE cosmohub.gaia_edr3 CHANGE duplicated_source duplicated_source boolean COMMENT "Source with multiple source identifiers";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_n_obs phot_g_n_obs smallint COMMENT "Number of observations contributing to G photometry";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_flux phot_g_mean_flux double COMMENT "G-band mean flux";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_flux_error phot_g_mean_flux_error float COMMENT "Error on G-band mean flux";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_flux_over_error phot_g_mean_flux_over_error float COMMENT "G-band mean flux divided by its error";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_g_mean_mag phot_g_mean_mag float COMMENT "G-band mean magnitude";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_n_obs phot_bp_n_obs smallint COMMENT "Number of observations contributing to BP photometry";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_flux phot_bp_mean_flux double COMMENT "Integrated BP mean flux";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_flux_error phot_bp_mean_flux_error float COMMENT "Error on the integrated BP mean flux";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_flux_over_error phot_bp_mean_flux_over_error float COMMENT "Integrated BP mean flux divided by its error";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_mean_mag phot_bp_mean_mag float COMMENT "Integrated BP mean magnitude";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_n_obs phot_rp_n_obs smallint COMMENT "Number of observations contributing to RP photometry";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_flux phot_rp_mean_flux double COMMENT "Integrated RP mean flux";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_flux_error phot_rp_mean_flux_error float COMMENT "Error on the integrated RP mean flux";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_flux_over_error phot_rp_mean_flux_over_error float COMMENT "Integrated RP mean flux divided by its error";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_mean_mag phot_rp_mean_mag float COMMENT "Integrated RP mean magnitude";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_n_contaminated_transits phot_bp_n_contaminated_transits smallint COMMENT "Number of BP contaminated transits";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_n_blended_transits phot_bp_n_blended_transits smallint COMMENT "Number of BP blended transits";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_n_contaminated_transits phot_rp_n_contaminated_transits smallint COMMENT "Number of RP contaminated transits";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_rp_n_blended_transits phot_rp_n_blended_transits smallint COMMENT "Number of RP blended transits";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_proc_mode phot_proc_mode tinyint COMMENT "Photometry processing mode";
ALTER TABLE cosmohub.gaia_edr3 CHANGE phot_bp_rp_excess_factor phot_bp_rp_excess_factor float COMMENT "BP/RP excess factor";
ALTER TABLE cosmohub.gaia_edr3 CHANGE bp_rp bp_rp float COMMENT "BP - RP colour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE bp_g bp_g float COMMENT "BP - G colour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE g_rp g_rp float COMMENT "G - RP colour";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_radial_velocity dr2_radial_velocity float COMMENT "Radial velocity from Gaia DR2";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_radial_velocity_error dr2_radial_velocity_error float COMMENT "Radial velocity error from Gaia DR2";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_nb_transits dr2_rv_nb_transits smallint COMMENT "Number of transits used to compute radial velocity in Gaia DR2";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_template_teff dr2_rv_template_teff float COMMENT "Teff of the template used to compute radial velocity in Gaia DR2";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_template_logg dr2_rv_template_logg float COMMENT "logg of the template used to compute radial velocity in Gaia DR2";
ALTER TABLE cosmohub.gaia_edr3 CHANGE dr2_rv_template_fe_h dr2_rv_template_fe_h float COMMENT "Fe/H of the template used to compute radial velocity in Gaia DR2";
ALTER TABLE cosmohub.gaia_edr3 CHANGE l l double COMMENT "Galactic longitude";
ALTER TABLE cosmohub.gaia_edr3 CHANGE b b double COMMENT "Galactic latitude";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ecl_lon ecl_lon double COMMENT "Ecliptic longitude";
ALTER TABLE cosmohub.gaia_edr3 CHANGE ecl_lat ecl_lat double COMMENT "Ecliptic latitude";
ANALYZE TABLE cosmohub.gaia_edr3 COMPUTE STATISTICS FOR COLUMNS;