3 Replies Latest reply on Mar 6, 2017 11:01 AM by Gary Wood

    Can TABCMD be used to determine if an extract is incremental?

    Gary Wood

      We have a process that leverages TABCMD to kick off extracts based on triggers in our environment - i.e. a database table gets loaded, and the process kicks off the datasource extract that depends on that table data.  The process is data-driven, using tables in our SQL Server database.

       

      What I am now seeing is that using this method, an explicit flag (--incremental) is required on the TABCMD line to tell Tableau the extract is indeed incremental.  Otherwise it treats it as a full extract and any previously extracted data gets wiped out.  Yikes.

       

      I could alter our process somewhat to include an "incremental" flag in the driving data tables, but that would require our Developers or Tableau folks to have individual knowledge of the datasources.  Sounds fragile to me.  I would prefer to be able to query Tableau somehow (ideally with TABCMD) and get a property back for a specific data source that tells me if the extract is full or incremental.

       

      It's not worth writing a lot of complex code for this work - I would want to have a super simple TABCMD call, or maybe a REST call that would provide me the info.  Has anybody been down this path before and have any short-cuts to share?

       

      Regards

      Gary

        • 1. Re: Can TABCMD be used to determine if an extract is incremental?
          Madhusudhan Khambham

          Hi Gary Wood

           

          Yes you have an option 'Synchronous' and 'Incremental' to tell if it is a Full/Incremental extracts. You can pass it to your Tableau server using TABCMD.

           

          tabcmd Commands

           

          PLease mark it as answered, if you feel that it answered your question.

           

          Thanks

          Madhu K

          • 2. Re: Can TABCMD be used to determine if an extract is incremental?
            Glen Robinson

            Hi Gary

            I think that what you are after is to be able to query Tableau Server as to whether an extract is incremental or full, and then get TABCMD to run that extract based on this information.

             

            The REST API gives you the ability to query information about a Refresh Task to find out whether as Task is incremental or Full.

            https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_ref.htm#Query_Extract_Refresh_Tasks%3FT…

            You can then run the tabcmd refreshextract command based on this information

            Hope this helps

            Glen

            2 of 2 people found this helpful
            • 3. Re: Can TABCMD be used to determine if an extract is incremental?
              Gary Wood

              Thanks to the respondents.  I think Glen was offering the closest to a technically correct answer, although I opted not to go that route since it would have required a fair amount of drilling into API calls to get things working.

               

              What I eventually did was to alter the batch file that executes the TABCMD command that performs the extract refresh, adding the --incremental switch.  I pipe the result to a text file which I can then inspect.  If the text file contains error code 80030, then I know the error is related to the --incremental switch being invalid for a Full extract.  So I re-issue the TABCMD without the --incremental switch, and perform a Full refresh.

               

              Not the most elegant solution I suppose, but it seems to work fine.  No background task is submitted to Tableau for any extract activity unless the TABCMD switches are valid, so the net impact of the two calls is that the datasource needs to be checked by Tableau for its Full/Incremental type.

               

              "e:\Tableau Server\10.0\bin\tabcmd" refreshextracts --no-certcheck --project Myproject --datasource MyFullDataSource --incremental 2> result.txt

              ::  Use your tool of choice to examine result.txt

              findstr "80030" result.txt >nul 2>&1

              if %ERRORLEVEL% == 0  (

                   "e:\Tableau Server\10.0\bin\tabcmd" refreshextracts --no-certcheck --project Myproject --datasource MyFullDataSource 2> result.txt

              )