@@ -29,7 +29,6 @@ namespace {
2929// ======================================================================================================================
3030
3131struct ES_Endpoints {
32-
3332 // ------------------------------------------------------------------------------------------------------------------
3433 // Bind
3534 // ------------------------------------------------------------------------------------------------------------------
@@ -42,7 +41,6 @@ struct ES_Endpoints {
4241
4342 static unique_ptr<FunctionData> Bind (ClientContext &context, TableFunctionBindInput &input,
4443 vector<LogicalType> &return_types, vector<string> &names) {
45-
4644 names.emplace_back (" provider_id" );
4745 return_types.push_back (LogicalType::VARCHAR );
4846 names.emplace_back (" organization" );
@@ -122,7 +120,6 @@ struct ES_Endpoints {
122120 // ------------------------------------------------------------------------------------------------------------------
123121
124122 static void Register (ExtensionLoader &loader) {
125-
126123 InsertionOrderPreservingMap<string> tags;
127124 tags.insert (" ext" , " eurostat" );
128125 tags.insert (" category" , " table" );
@@ -137,7 +134,6 @@ struct ES_Endpoints {
137134// ======================================================================================================================
138135
139136struct ES_Dataflows {
140-
141137#define INFO_COLUMN_PROVIDER_ID 0
142138#define INFO_COLUMN_DATAFLOW_ID 1
143139#define INFO_COLUMN_TYPE 2
@@ -174,7 +170,6 @@ struct ES_Dataflows {
174170 // ! Parse DataflowInfo from JSON object
175171 inline static DataflowInfo ParseDataflow (const string &provider_id, yyjson_val *object_val,
176172 bool &load_datastructure, bool &load_annotations) {
177-
178173 yyjson_val *extension_val = nullptr ;
179174 yyjson_val *annotation_val = nullptr ;
180175 yyjson_val *attrib_val = nullptr ;
@@ -300,7 +295,6 @@ struct ES_Dataflows {
300295
301296 static unique_ptr<FunctionData> Bind (ClientContext &context, TableFunctionBindInput &input,
302297 vector<LogicalType> &return_types, vector<string> &names) {
303-
304298 std::vector<string> providers;
305299 std::vector<string> dataflows;
306300 string language = " en" ;
@@ -417,7 +411,6 @@ struct ES_Dataflows {
417411 };
418412
419413 static unique_ptr<GlobalTableFunctionState> Init (ClientContext &context, TableFunctionInitInput &input) {
420-
421414 const auto &bind_data = input.bind_data ->Cast <BindData>();
422415 const auto &providers = bind_data.providers ;
423416 const auto &dataflows = bind_data.dataflows ;
@@ -519,7 +512,6 @@ struct ES_Dataflows {
519512 // ------------------------------------------------------------------------------------------------------------------
520513
521514 static void Execute (ClientContext &context, TableFunctionInput &input, DataChunk &output) {
522-
523515 auto &gstate = input.global_state ->Cast <State>();
524516
525517 // Calculate how many record we can fit in the output
@@ -659,7 +651,6 @@ struct ES_Dataflows {
659651 // ------------------------------------------------------------------------------------------------------------------
660652
661653 static void Register (ExtensionLoader &loader) {
662-
663654 InsertionOrderPreservingMap<string> tags;
664655 tags.insert (" ext" , " eurostat" );
665656 tags.insert (" category" , " table" );
@@ -696,7 +687,6 @@ static constexpr const char *ES_VALUES_PATH =
696687static constexpr const char *ES_ERROR_PATH = " /S:Fault/faultstring" ;
697688
698689struct ES_DataStructure {
699-
700690 // ! Information of a Dimension of an EUROSTAT Dataflow
701691 struct Dimension {
702692 int32_t position = -1 ;
@@ -709,7 +699,6 @@ struct ES_DataStructure {
709699 // ! Returns the basic data structure of an EUROSTAT Dataflow.
710700 static std::vector<Dimension> GetBasicDataSchema (ClientContext &context, const string &provider_id,
711701 const string &dataflow_id, const string &language) {
712-
713702 std::vector<Dimension> dimensions;
714703
715704 // Execute HTTP GET request
@@ -738,9 +727,7 @@ struct ES_DataStructure {
738727 xmlXPathObjectPtr xpath_obj = nullptr ;
739728
740729 for (const auto &xpath : {ES_DIMENSION_PATH , ES_TIME_DIMENSION_PATH }) {
741-
742730 if ((xpath_obj = xmlXPathEvalExpression (BAD_CAST xpath, xpath_ctx)) && xpath_obj->nodesetval ) {
743-
744731 for (int i = 0 ; i < xpath_obj->nodesetval ->nodeNr ; i++) {
745732 xmlNodePtr node = xpath_obj->nodesetval ->nodeTab [i];
746733
@@ -790,17 +777,14 @@ struct ES_DataStructure {
790777 // Get the Concept names for Dimensions
791778
792779 if ((xpath_obj = xmlXPathEvalExpression (BAD_CAST ES_CONCEPT_PATH , xpath_ctx)) && xpath_obj->nodesetval ) {
793-
794780 for (int i = 0 ; i < xpath_obj->nodesetval ->nodeNr ; i++) {
795781 xmlNodePtr node = xpath_obj->nodesetval ->nodeTab [i];
796782
797783 auto concept_id = XmlUtils::GetNodeAttributeValue (node, " id" );
798784 if (!concept_id.empty ()) {
799785 for (auto &dim : dimensions) {
800786 if (dim.concept_id == concept_id) {
801-
802787 for (xmlNodePtr child = node->children ; child; child = child->next ) {
803-
804788 if (strcmp ((const char *)child->name , " Name" ) == 0 ) {
805789 string lang = XmlUtils::GetNodeAttributeValue (child, " lang" , language);
806790
@@ -826,7 +810,6 @@ struct ES_DataStructure {
826810 // ! Returns the data structure of an EUROSTAT Dataflow.
827811 static std::vector<Dimension> GetDataSchema (ClientContext &context, const string &provider_id,
828812 const string &dataflow_id, const string &language) {
829-
830813 auto dimensions = ES_DataStructure::GetBasicDataSchema (context, provider_id, dataflow_id, language);
831814
832815 // Execute HTTP GET request
@@ -853,7 +836,6 @@ struct ES_DataStructure {
853836 xmlXPathObjectPtr xpath_obj = nullptr ;
854837
855838 if ((xpath_obj = xmlXPathEvalExpression (BAD_CAST ES_VALUES_PATH , xpath_ctx)) && xpath_obj->nodesetval ) {
856-
857839 for (int i = 0 ; i < xpath_obj->nodesetval ->nodeNr ; i++) {
858840 xmlNodePtr node = xpath_obj->nodesetval ->nodeTab [i];
859841
@@ -863,7 +845,6 @@ struct ES_DataStructure {
863845
864846 for (auto &dim : dimensions) {
865847 if (dim.id == dim_id) {
866-
867848 for (xmlNodePtr child = node->children ; child; child = child->next ) {
868849 if (strcmp ((const char *)child->name , " Value" ) == 0 ) {
869850 string code_value = XmlUtils::GetNodeTextContent (child);
@@ -900,7 +881,6 @@ struct ES_DataStructure {
900881
901882 static unique_ptr<FunctionData> Bind (ClientContext &context, TableFunctionBindInput &input,
902883 vector<LogicalType> &return_types, vector<string> &names) {
903-
904884 D_ASSERT (input.inputs .size () == 2 );
905885
906886 const string provider_id = StringValue::Get (input.inputs [0 ]);
@@ -975,7 +955,6 @@ struct ES_DataStructure {
975955 // ------------------------------------------------------------------------------------------------------------------
976956
977957 static unique_ptr<NodeStatistics> Cardinality (ClientContext &context, const FunctionData *data) {
978-
979958 auto &bind_data = data->Cast <BindData>();
980959 auto result = make_uniq<NodeStatistics>();
981960
@@ -991,7 +970,6 @@ struct ES_DataStructure {
991970 // ------------------------------------------------------------------------------------------------------------------
992971
993972 static void Execute (ClientContext &context, TableFunctionInput &input, DataChunk &output) {
994-
995973 auto &bind_data = input.bind_data ->Cast <BindData>();
996974 auto &gstate = input.global_state ->Cast <State>();
997975
@@ -1086,7 +1064,6 @@ struct ES_DataStructure {
10861064 // ------------------------------------------------------------------------------------------------------------------
10871065
10881066 static void Register (ExtensionLoader &loader) {
1089-
10901067 InsertionOrderPreservingMap<string> tags;
10911068 tags.insert (" ext" , " eurostat" );
10921069 tags.insert (" category" , " table" );
@@ -1109,7 +1086,6 @@ struct ES_DataStructure {
11091086// ! Returns the data structure (dimensions) of a given dataflow
11101087std::vector<eurostat::Dimension> EurostatUtils::DataStructureOf (ClientContext &context, const std::string &provider_id,
11111088 const std::string &dataflow_id) {
1112-
11131089 auto dimensions = ES_DataStructure::GetBasicDataSchema (context, provider_id, dataflow_id, " en" );
11141090 std::vector<eurostat::Dimension> data_structure;
11151091
@@ -1122,7 +1098,6 @@ std::vector<eurostat::Dimension> EurostatUtils::DataStructureOf(ClientContext &c
11221098
11231099// ! Extracts the error message of a given Eurostat API response body
11241100std::string EurostatUtils::GetXmlErrorMessage (const std::string &response_body) {
1125-
11261101 XmlDocument document = XmlDocument (response_body);
11271102 xmlXPathContextPtr xpath_ctx = document.GetXPathContext ();
11281103 xmlXPathObjectPtr xpath_obj = nullptr ;
@@ -1131,7 +1106,6 @@ std::string EurostatUtils::GetXmlErrorMessage(const std::string &response_body)
11311106
11321107 if ((xpath_obj = xmlXPathEvalExpression (BAD_CAST ES_ERROR_PATH , xpath_ctx)) && xpath_obj->nodesetval &&
11331108 xpath_obj->nodesetval ->nodeNr > 0 ) {
1134-
11351109 xmlNodePtr node = xpath_obj->nodesetval ->nodeTab [0 ];
11361110 error_msg = XmlUtils::GetNodeTextContent (node);
11371111 }
@@ -1144,7 +1118,6 @@ std::string EurostatUtils::GetXmlErrorMessage(const std::string &response_body)
11441118}
11451119
11461120void EurostatInfoFunctions::Register (ExtensionLoader &loader) {
1147-
11481121 ES_Endpoints::Register (loader);
11491122 ES_Dataflows::Register (loader);
11501123 ES_DataStructure::Register (loader);
0 commit comments