Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.0.11
    • Fix Version/s: 10.0.12
    • Component/s: None
    • Labels:

      Description

      Copy the following test case into a file under storage/connect/mysql-test/connect/t:

      CREATE TABLE t1 (c INT PRIMARY KEY) ENGINE=CONNECT TABLE_TYPE=CSV;
      INSERT INTO t1 VALUES (1),(2);
      --query_vertical EXPLAIN SELECT AVG(c) FROM t1
      drop table t1;
      

      Observe that the result contains

      rows    4

      even though the table has only two rows. This becomes important when the number of rows in the table grows large.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bertrandop Olivier Bertrand added a comment -

            I don't understand this result. A functional query such as above always return 1 row.

            Now the issue is about the "records" info item. When asked for the number of rows in a table, CONNECT can give an exact number for fix record length tables by dividing the file size by the lrecl. However, for variable record size tables such as DOS, CSV or FMT, CONNECT returns an estimate of the maximum number of rows obtained by dividing the file size by the record minimum size. This is done to give this information quickly without reading the whole file.

            This can be reconsider if there is a need to have an exact number for some applications. The discussion is open.

            Show
            bertrandop Olivier Bertrand added a comment - I don't understand this result. A functional query such as above always return 1 row. Now the issue is about the "records" info item. When asked for the number of rows in a table, CONNECT can give an exact number for fix record length tables by dividing the file size by the lrecl. However, for variable record size tables such as DOS, CSV or FMT, CONNECT returns an estimate of the maximum number of rows obtained by dividing the file size by the record minimum size. This is done to give this information quickly without reading the whole file. This can be reconsider if there is a need to have an exact number for some applications. The discussion is open.
            Hide
            serg Sergei Golubchik added a comment -

            For CSV tables with the variable row length, the Connect engine has no a priori way of knowing the exact number of rows in the table.

            Show
            serg Sergei Golubchik added a comment - For CSV tables with the variable row length, the Connect engine has no a priori way of knowing the exact number of rows in the table.

              People

              • Assignee:
                bertrandop Olivier Bertrand
                Reporter:
                serg Sergei Golubchik
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: