Table view showing 25% of results

I’m running 0.35.4 and have a custom SQL query that does some calculation to populate a temporary table in MSSQL then does a select * from [table]. This has 22 rows currently. Metabase shows only 6 no matter what I do. Any ideas?

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "Java(TM) SE Runtime Environment",
    "java.runtime.version": "1.8.0_201-b09",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_201",
    "java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
    "java.vm.version": "25.201-b09",
    "os.name": "Linux",
    "os.version": "4.15.0-101-generic",
    "user.language": "en",
    "user.timezone": "America/New_York"
  },
  "metabase-info": {
    "databases": [
      "sqlserver",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "10.12 (Ubuntu 10.12-0ubuntu0.18.04.1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.8"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.35.4",
      "date": "2020-05-28",
      "branch": "release-0.35.x",
      "hash": "b3080fa"
    },
    "settings": {
      "report-timezone": "US/Eastern"
    }
  }
}

Hi @brennan
I don’t understand - are you just running select * from [table] from Metabase or a multi-statement query that creates a temporary table?
Check log on your SQL Server to see what query it’s running and what results are being sent back.

I’m running a series of sql commands that creates / populates / select * from [temp_table] in my metabase question. The download result to csv is correct from the question page and includes all 22 results. The table visualization itself only has the first 6 records. (1/4 * 22 = 5.5, rounds up to 6 rows).

@brennan I’ve never heard of this before. Check the response from the request (/api/dataset if unsaved, /api/card/:id/query if saved) in your browser developer Network-tab.
Or perhaps you’re returning two dimensions and one metric, so the table is auto-converted to a Pivot? Change that in visualization Settings.

Very odd, in the developer tools for /api/car/:id/query this is shown:

  1. json_query: {constraints: {max-results: 10000, max-results-bare-rows: 2000}, type: “native”, middleware: null,…}

  2. async?: true

  3. cache-ttl: null

  4. constraints: {max-results: 10000, max-results-bare-rows: 2000}

  5. database: 2

  6. middleware: null

  7. native: {,…}

  8. type: “native”

  9. row_count: 6

  10. running_time: 246

@brennan In the response, check the data.native_form.query and compare it to when you download as CSV

The data.native_form query seems to be identical (when executed in SQL Server Management Studio) to the csv result upon download.

@brennan I have never seen something like this before, but the server is returning 6 rows, so check the log on the server to figure out what is different between the two queries.
And make sure you’re not hitting cache (Admin > Settings > Caching)