Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4377

Split DataConvert::convertColumnData()

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 5.5.1
    • ExeMgr
    • None

    Description

      There is a method DataConvert::convertColumnData() which contains a huge switch handing all data types:

      boost::any
      DataConvert::convertColumnData(cscDataType typeCode,
                                      const datatypes::SystemCatalog::TypeAttributesStd& colType,
                                      const std::string& dataOrig, bool& pushWarning,
                                      const std::string& timeZone, bool nulFlag,
                                      bool noRoundup, bool isUpdate)
      {
          ...
          switch (typeCode)
          {
              case datatypes::SystemCatalog::TINYINT:
              ...
              case datatypes::SystemCatalog::SMALLINT:
              ...
       
          }
          ...
      }
      

      Let's remove this method from DataConvert add:

      • a new virtual method TypeHandler::convertFromString()
      • a new class datatypes::ConvertFromStringParam (to pass parameters to easier)

      about as follows:

      class ConvertFromStringParam
      {
        const std::string& m_timeZone;
        const bool m_noRoundup;
        const bool m_isUpdate;
      public:
        ConvertFromStringParam(const std::string& timeZone,
                               bool noRoundup, bool isUpdate)
         :m_timeZone(timeZone),
          m_noRoundup(noRoundup),
          m_isUpdate(isUpdate)
        { }
        const std::string& timeZone() const { return m_timeZone; }
        bool noRoundup() const { return m_noRoundup; }
        bool isUpdate() const { return m_isUpdate; }
      };
      
      

      virtual boost::any convertFromString(const SystemCatalog::TypeAttributesStd& colType,
                                           const ConvertFromStringParam& prm,
                                           const std::string& str,
                                           bool& pushWarning) const = 0;
      

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.