none
Problems insert USQL

    Question

  • Hi,

    I am new in USQL and I have problems when I try insert data in a table previously created. My query is this:


    @searchlog = 
        EXTRACT 
        Id_Pregunta_Informe int,
        Id_Tipo int,
        Texto1 string,
        Texto2 string,
        Texto3 string,
        Texto_Aclaratorio string,
        Pag int,
        Orden int,
        Nombre string,
        Cadena int,
        Color string,
        Obligatoria int,
        Nivel int,
        Sin_Calculo int,
        Nombre_Nivel string,
        Is_Pregunta string,
        Valoracion float,
        Tipo string,
        Valortxt string,
        Valor float,
        Id_Respuesta int,
        ErrorFatal int,
        Peso float,
        Clave float,
        Estudio string,
        Turno string,
        Fecha DateTime,
        Plataforma string,
        Agente string,
        Proveedor string,
        Servicio string,
        Periodo float,
        Ola string,
        Mes string,
        Horario string,
        Control string,
        Tipologia string,
        Llamada string,
        Rechazado string,
        Bimestre string,
        Supervisor string,
        Id int
        FROM @"/Samples/Informe_resumen.txt"
        USING Extractors.Text();

    //Insert it into a previously created table
    INSERT INTO [Informes].[dbo].[Informe_resumen]
    SELECT *
    FROM @searchlog;

    The error is while running:

    <label class="msportalfx-text-label" data-bind="text: titleLabel" style="font-family:az_ea_font, wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif;line-height:normal;text-transform:uppercase;color:#2d3239;">ERROR</label>
    VertexFailedFast. Vertex failure triggered quick job abort. Vertex failed: SV1_Extract_Partition[0][0] with error: Vertex user code error.
    <label class="msportalfx-text-label" data-bind="text: descriptionLabel" style="font-family:az_ea_font, wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif;line-height:normal;text-transform:uppercase;color:#2d3239;">DESCRIPTION</label>
    Vertex failed with a fail-fast error
    <label class="msportalfx-text-label" data-bind="text: resolutionLabel" style="font-family:az_ea_font, wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif;line-height:normal;text-transform:uppercase;color:#2d3239;">RESOLUTION</label>
    <label class="msportalfx-text-label" data-bind="text: detailsLabel" style="font-family:az_ea_font, wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif;line-height:normal;text-transform:uppercase;color:#2d3239;">DETAILS</label>

    Vertex SV1_Extract_Partition[0][0].v1 {7C7C7301-24F0-47EB-B859-393BB7F36F5D} failed Error: Vertex user code error exitcode=CsExitCode_StillActive Errorsnippet=An error occurred while processing a

    I don´t know what I´m doing wrong.

    Thanks!


    Tuesday, March 22, 2016 8:33 AM

All replies

  • Sorry the error can´t read properly.

    ERROR
    VertexFailedFast. Vertex failure triggered quick job abort. Vertex failed: SV1_Extract_Partition[0][0] with error: Vertex user code error.
    DESCRIPTION
    Vertex failed with a fail-fast error
    RESOLUTION
    DETAILS

    Vertex SV1_Extract_Partition[0][0].v1 {7C7C7301-24F0-47EB-B859-393BB7F36F5D} failed 

    Error:
    Vertex user code error

    exitcode=CsExitCode_StillActive Errorsnippet=An error occurred while processing a

    Tuesday, March 22, 2016 8:35 AM
  • Dear Pablo

    Unfortunately, it looks like the error message is getting cut off. You can find the detailed error message by:
    1. In Visual Studio, from the job browser, click on “Resources” link in the Job Detail section of your job window.
    2. Once the job resources are loaded, click on “Profile” and open it.
    3. Search for the string “jobError” inside the Profile. Copy the entire line of text and paste in notepad to read the actual error.

    Now in your example, some speculation here as to why you may see the error is that the data that you are extracting is not a valid instance of one of the types. For example, all scalar C# value types (int, float etc) are not nullable per default. While string types are nullable. so if your input data contains a value that is the zero length string that gets mapped to int, you will get an error. You can mark the types as nullable in your extract (and table) schema, e.g., int?.

    Alternatively, I see you using float as a datatype. If your data contains a string representation of a float value that is not aligned with the expected culture (see https://msdn.microsoft.com/en-us/library/azure/mt621366.aspx for details), you will get a cast error. For example, your data uses , as the decimal point. If you are using that, you should extract it as a string and then cast it with the right culture information.

    I hope this helps. Feel free to reply with more details on the error message or any followup questions.


    Michael Rys

    • Proposed as answer by Michael Amadi Friday, April 8, 2016 6:56 AM
    Tuesday, March 22, 2016 9:08 PM
    Moderator